views:

1489

answers:

9

I need to encrypt some PHP source that I've released to the public.

Is this possible? Can PHP be "compiled" ?

+3  A: 

You can have a look at phc which can generate executables from PHP. It also has some other options to create C-code, XML, optimized PHP, etc. from the original PHP source.

Kosi2801
A: 

There is some of software available to encrypt PHP sources to protect intellectual property. I do not know any free ones, though. Just google something like "php encrypt source" if you're ok with paying/shareware.

+1  A: 

Nusphere (the makers of PhpED) have a product called Nu-coder for doing exactly this. Although not free, it will do what you want.

tj111
+1  A: 

You can buy Zend Guard to encode your PHP sources, and then use the Zend Optimizer to run it. There is an opensource/free PHP compiler project as well (bcompiler, and also take a look to this) but I never used it because at the time I needed it the project was still incomplete.

tunnuz
A: 

I've tried Nu-Coder and the other above options, but these don't seem to be any good at this time since they need to run on a wide range of boxes, some of which don't have access to install things like Zend Optimizer and PHP Express Loader

footose
Try commenting directly on answers rather than posting an answer that is just a comment.
leek
@leek, unfortunately the site requires you have 50 rep before you can comment.
Zoredache
Keep in mind YOU are the one who asked if PHP could be compiled.
TravisO
@Zoredache - If that is the case, then try incremental question updates that address answerer's.
leek
+2  A: 

since they need to run on a wide range of boxes, some of which don't have access to install things like Zend Optimizer and PHP Express Loader

If you need your code to be able to run on a standard version of PHP without any modules then the answer is NO. There is no method of compilation that is going to work on the wide variety of different PHP installations.

Zoredache
+1  A: 

I've tried converting it to bytecode, and it seems to run so far on all the test machines i've tried.

That being said, it costs money for the only bytecode compiler out there, are there any free ones?

footose
A: 

hi yes it possible go to http://www.rightscripts.com/phpencode/index.php where you can paste your config code then encode it,now paste encode text into config file,it will work same has previous file,but nobody can read it

have dream day thaks

rubyid10
A: 

have a look at http://www.ioncube.com/

CountZero