How is it possible to protect PHP code? [closed]
Is it possible to protect PHP code witho开发者_运维问答ut using a compiled module (.so/.dll)?
What software can help with this?
There's a lot of tools to do this. Type "protect PHP" into Google.
Some encrypt your source code. This is a bad scheme; the very machinery needed to decrypt the code gets shipped with it. (There are even tools to decrypt all the known PHP encryptor products if you look hard enough.).
Some obfuscate your code, that is, make it difficult to read and understand the source code. If you code has any scale (e.g., dozens of PHP scripts working together), this can be very effective. These don't require any changes to the receiving PHP server system.
A few compile your code to PHP byte code schemes. These certainly make it hard to see the source text, but generally require the receiving system to accept pre-compiled code. The problem here is that you may have to convince the recipient to install special modules, and most PHP server sites aren't interested in changing thier configuration just for you.
I'm a obfuscator product provider, so you might not trust my opinion.
If you're serious then it has to be Zend Guard : http://www.zend.com/en/products/guard/
If you mean protect it from people being able to see the source, then its a simple matter of keeping someone out of your actual server. Whenever someone requests a PHP page it is parsed by the server and the person would get the output and not the actual PHP source.
You could distribute it obfuscated:
http://www.raizlabs.com/software/phpobfuscator/
However this doesn't fully protect your code, it's security through obscurity. Apart from that, I know of no way to protect your code other than run it as a paid service as supposed to distribution.
精彩评论