Before we start, we must first clarify two issues: First, supporting open source does not mean opposing code encryption; second, it is even more inappropriate to open source things that do not belong to you (such as the company's).
As I know before, Zend’s encoder is used to encrypt PHP codes. This is not only a commercial software, but it seems to have problems that can be cracked, so I found an alternative solution────php_screw, a Stuff developed by the Japanese.
php_screw is very small. I have not read its algorithm carefully, but from the documentation, you can change the SEED yourself, and then compile the so and executable files yourself. If you are good enough, you can even change the algorithm yourself. In any case, for us "ordinary people", this kind of encryption should be enough. If you really want to be watertight, it's better not to make it public. Although the author said that it is not easy to crack, I don't know where it is. What about the cattle, right?
The installation environment requires: PHP5.x, zlib enabled, autoconf, automake installed.
Test environment: Ubuntu 8.04 hardy, PHP 5.2.3.
Download address: http://sourceforge.net/projects/php-screw/
1. Unzip and change my_screw.h. The numbers inside are SEED, which is equivalent to a password. You can change or increase it at will, and the number of numbers does not affect the decryption speed.
2. Compile the so file:
Update @ 2008-09-01
After encryption, there is still a small problem. When you use require or include to reference the encrypted code placed under include_path, it will be quoted as clear text. There are two solutions:
Use an absolute path to reference the encrypted content placed under include_path. If it is your own host, it will definitely be no problem;
Use a relative path to reference, such as in a subdirectory of this project, this is also no problem.