hello, is there a way to make a binary of php code? what i mean is, i write a script and dont want anyone to be able to see the source code at all, is this possible?
im working on a script and dont want to give the client access to source code. thanks
how to secure php code
This is not possible. Make a binary.
Even if there are compiled binary extension DLL modules for PHP itself to run.
What you can do to protect your php scripts & code is to use
obfuscator scripts.
This will make the php very hard to fix to read in a normal way.
Drawback is that obfuscated code will execute a bit slower
as it needs to be interpretated to something the php can execute.
Here is a google search for FREE Obfuscator scripts:
[URL="http://www.google.com/#hl=en&source=hp&q="open+source"+php+obfuscator"]http://www.google.com/#hl=en&source=hp&q="open+source"+php+obfuscator[/URL]
Here is one such. I do not know how fresh or good this one is, but ...
PhpCodeBuster - An Open Source PHP Obfuscator
This is the project page for PhpCodeBuster, a freely available and open source PHP class to protect your PHP code.
Using PhpCodeBuster, your PHP scripts will get obfuscated, meaning that the code is changed in such a way that it is very hard to reverse engineer it into a understandable format.
you can encode it using Zend Guard or ionCube or one of the others
There are some actual PHP compilers out there which will generate binary executables. This, however, makes them platform-dependent, which may or may not be an issue for your intended needs. One example: http://www.roadsend.com/home/index.php?pageID=compiler.
There are "native compilers" for PHP (Pradioblender and binaryphp spring to mind), but they basically work by taking the PHP interpreter and embedding a copy of the script as a resource (the main issue is the need for PHP to be able to execute strings as code). If it's a native executable you want you'd be better served by using a language that can be compiled natively.