In the process of using PHP, I found that the PHP code you write because it is the source code is placed on the server, so it is easy to be taken by others to modify (into their own development) to use.
I have been looking for a software that can encrypt PHP code in order to keep the fruits of my labor.
The most famous is the Zend Company's Zendencoder, but is not open source software (the price is very high, also did not find cracked version).
Since the fees are not available, we will use open source. I found php_screw this open source software, currently the latest version is 1.5
Installation Environment
System: CentOS 5.3
Software: Apache 2.2.9
PHP 5.2.10
The above environment is all installed by their own download configuration. For specific Apache+php+mysql installation methods, please search online.
Installation
1. Unzip the TAR-ZXVF php_screw-1.5.tar.gz with tar
2. Enter the php_screw-1.5 directory to start the installation
CD php_screw-1.5
Phpize
As for the phpize, it is just the Php5-dev module installed in the Php5-dev expansion module.
./confiugre
3. Set the password you use to encrypt
Copy CodeThe code is as follows:
VI my_screw.h
--The Encryption SEED key (Pm9screw_mycryptkey) into the
Values according to.
The encryption would be a harder to break and if you add more values to the
Encryption SEED Array. However, the size of the SEED is unrelated to
The time of the decrypt processing.
* If You can read and understand the source code, to modify an original
Encryption logic would be possible. It is should not
be necessary.
optional:encrypted scripts get a stamp added to the beginning of the
File. If you like, stamp defined by
Pm9screw and Pm9screw_len in Php_screw.h. Pm9screw_len must
be less than or equal to the size of pm9screw.
4. Compiling
Make
5. Copy the php_screw.so file under the modules directory to the/usr/lib/php5/extension directory
CP modules/php_screw.so/usr/lib/php5/extension/
6. Edit the php.ini file
In the php.ini file, add the following statement
Extension=php_screw.so
7. Restart Apache
/srv/apache/bin/apachectl restart
8. Compile the Encryption tool
CD Tools
Make
9. Copy the tool screw in the tools directory to the appropriate directory
CP screw/usr/bin/
After the above 10 steps, the php_screw-1.5 has been installed all completed. And now PHP has supported the interpretation of encrypted PHP files.
use
1. Now write a PHP file to encrypt.
I wrote the following test.php file for testing php speed
Copy CodeThe code is as follows:
$a = 0;
$t =time ();
for ($i =0; $i <5000000; $i + +)
{$a = $a * $i;}
$t 1=time ();
echo "
";
echo "It used:";
Echo $t 1-$t;
echo "seconds";
?
Place the above test.php file in the/var/www/directory. Browser access will show the speed (rough estimate) of PHP in a large number of calculations
2. Encrypt the PHP file we wrote
cd/var/www/
Screw test.php
After we encrypt, Now the test.php file in the directory is what we have encrypted. And the source file was renamed Test.php.screw stored.
Let's test the test.php again to see if we can use it properly? How fast?
I compared a bit, the speed before and after the encryption is probably the same, basically not too much loss.
3. Batch encryption file
tested on Debian, apache2, php5 to correctly parse the. html file after encryption,
Php_screw How to file in the directory under the current directory, and the files in the containing directory for the overall encryption
find./-name "*.php"-print|xargs-n1 screw//Encrypt all. php files
Find./-name "*.screw"-print/xargs-n1 RM//Delete all backup files for. PHP source Files
all the. php files in the current directory are encrypted with the full back
http://www.bkjia.com/PHPjc/327734.html www.bkjia.com true http://www.bkjia.com/PHPjc/327734.html techarticle in the use of PHP process found that their own PHP code is written by the source code is placed on the server, so it is easy to be taken by others to modify (into their own development) use ...