securing PHP code [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I do quite large project for a client and I would like (somehow) to secure code form event that mid dishonest client was not going to pay me for the work. :)
The contract is written that the project must provide application with a sources.
So far I mostly been writing in .NET where I was protecting myself against such an eventuality in way that I was creating class witch get POST some parameters with shutdown application. This class was thrown into a dll witch was already compiled, so no one could change the source.
Is there a similar possibility in PHP? I can do the same thing (as in .NET case) but clever customers with access to PHP can find above class and I just cut it.
Maybe it is some other way to secure myself?
Suturing of the database also eliminated for similar reasons as above.

PHP is an interpreted language; as a result, it doesn't compile your code. Your best bet is to stick with .NET, where you can compile the functional part of the application into a .dll, or use Java and compile it into a bytecode.
PHP wasn't built for compiling.
What you can do is probably host the application on your server till the client has made a payment, and then upload it to the client's server.
Or you can make it downloadable from your server (only after payment), along with configuration scripts that is configurable by anyone with a few clicks of the button; something similar to the way some of the PHP frameworks (e.g. WordPress) work.

You can protect your code with Zend Guard (http://www.zend.com/en/products/guard/).

Related

Can I mix PHP with other scripting language? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I made a NGO website that has customer service in it, means that clients are able to chat directly to the admin. I've built 30% of it with PHP. But, I thought it's difficult to make a chat application with PHP. I've been told that Node.js is the best web development to make chat application. Can I mix PHP with Node.js ?
Generally, people name files depending on what language the code inside is written in. For example, the .php extension is run by a PHP interpreter. Certain files can have other languages mixed in. For example, a .html file can contain CSS and Javascript. Another example is the .html.erb extension in a Rails app, which can contains both Ruby and HTML/CSS/JS code. This is accomplished by something known as a preprocessor.
You could use a preprocessor to mix mostly any language together, but I'm not sure that will make your life any easier making an app. It's probably a better idea to separate your app into microcomponents, which can all be written in different languages.
For example, a chat server could be written in Node and a REST API written in Rails. They might be hosted on separate servers and communicate with each other by sending HTTP requests.
As far as Node being "the best" for making a chat server, that's a totally subjective point and StackOverflow discourages opinion-based conjectures.
It's also worth considering whether an open-source chat project could be integrated with your existing code. I.e. something already made.

Web server to handle multiple ad hoc Scala scripts? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
For one of my simple appplications, all the routing is handled by nginx. I just put the php files in the directory referenced and they are serve requests: no framework is used. I am trying to migrate this scheme to Scala: I want to do it by gradually replacing each php script with one in Scala.
Is there a Scala counterpart of a php server that can automatically compile and serve all scala files under a directory? So that when I put code in /book/new.scala, /book/buy.scala, /user/login/auth.scala, etc, the server would compile and serve all of them for corresponding requests?
In the strictest technical sense, Scala can be used as a "scripting language," but it's rather limited in what can be reasonably done that way.
As others have commented, you should make a proper server for or out of you Scala application. There are many options from simple and lightweight to big and fancy. Most use the Java Servlet Container, but some implement their own HTTP server side.
You have many options to choose from, but "scripting" really is not among the viable ones.
You might look at the Lift Framework, and aim to only use the endpoint/RESTful part of the framework. In this way you can identify key requests to the webserver and pass them off to Scala-based code. Lift would manage the webserver part of everything.
That said, this is a very strange way to manage a web application, and harkens back to the 90s-era CGI-script based architectures. Ask yourself why you're attempting to model things this way before proceeding, and ask if the difficulty of running two containers (php and Scala) is really worth the trouble in order to 'ease' migration.

Linux, Apache, PHP - need solution for document upload, edit, and version control [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am developing an internal website that is running Linux, Apache, PHP and CodeIgniter. I need to find a solution to satisfy the following:
Document upload. (Think word docs, excel docs and pdfs)
Document edit/checkout capabilities.
Document version control (who made what changes when to this document)
Wiki capabilities. (view, edit, create text for certain pages within the site)
Each of these things will be native within the intranet site. I do not want to link to another system to conduct the above tasks. I want all of the controls within the site itself.
I considered turning up sharepoint and mediawiki and using API calls to interact with it. However sharepoint doesn't play nice with Linux when it comes to APIs. Mediawiki has a horrible set of tools to add text stylizing. Making something bold/italics/underline is not intuitive at all.
Is there a plugin for apache which acts as a CMS backend? Is there some project that I could use to help me here? I am willing to build it from scratch but I also want to be smart about it. Any ideas what to use here?
What you're looking for is called a "document management system" and there are dozens of open-source free ones available. Do not invent one from scratch. You will spend months and will be stuck maintaining this system for years
If you want WYSIWYG editing, consider TinyMCE or CKEditor, both are great, and relatively easy to integrate into whatever backend.

Protect a part of an application's code sources [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am developing an ERP application.
Next month I will recruit 2 employees, developers.
The application consists of two parts:
The core of the system
modules.
Is there a way to "protect" the core of the system for a possible theft from new employees? I do not want to see my codes with competitors in a few months (risk exists).
I thought to limit access via FTP, SVN work, etc.. but thinking about it, I found that the developer has always a way to know the core of the system files (a simple display php directory) or execute a script that will rename the. php. txt to be able to download it...
Encoding the core with Ioncube will be suffisant ?
Other solution ?
This is really a legal and not a programming matter. You should have them sign non-disclosure and non-competition agreements and call it a day - coming up with unneccessarily complex solutions is really unneccessary.
I thought to limit access via FTP, SVN work, etc.. but thinking about it, I found that the developer has always a way to know the core of the system files or execute a script that will rename the. php. txt to be able to download it...
Obviously. Realise that any security invented by a human can be circumvented by another. You still should impose such restrictions - if they do gain access to the application core, you may need to prove that this could only be possible by intentionally circumventing security measures.
To be blunt, always give employees the access they need to do their job, but never more than that.

PHP connect to AIM TOC [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
In the middle of 2010, I found a class library called PHPToCLib. It ran flawlessly for over a year - I was able to implement a tremendous amount of my own, custom code into a an AIM Bot that I could run from my CMD Prompt. However, near the end of 2011, the servers stopped responding to the script. It connects to toc.oscar.aol.com on port 5190, and that hasn't been changed. I am indeed aware that AOL discontinued their TOC2 servers and that it's not possible to connect with them anymore. However, I downloaded a program called TerraIM that uses the same specifications and is somehow able to connect to them. I was wondering if there were any updates on how I could get my script to connect, and if so, what do I need to change?
Thank you in advance.
TerraIM also supports the OSCAR protocol which I assume it's defaulting to. If you are working with IM bots the absolute best way to go is to leverage libpurple. Unfortunately there is not a good PHP binding to libpurple. There are a couple python bindings. If you don't wish to migrate your code, there is an implementation that provides an HTTP interface which may be easy to integrate with depending on your use case. Alternatively, you could use thrift to comminute between your existing PHP code and the python bindings -- this would require a bit more coding than leveraging an HTTP interface. Here are some resources you may find helpful:
Python bindings:
github.com/fahhem/python-purple
github.com/Raptr/Heliotrope
HTTP interface from HTTP binding:
github.com/atamurad/http-purple
Thrift:
http://thrift.apache.org/

Categories