Test environment: Ubuntu 10.04 hard, PHP 5.2.3.
Download the lamp installation package at http: // 74.117.62.221/QQ/ubuntulamp.tar.
Download screw. h
Php_screw-1.5.tar.gz
(7.14 KB)
Downloads: 2
24 minutes ago
Download consumption 5 1
1. decompress the package and change my_screw.h. The numbers in the package are seed, which is equivalent to passwords. You can change and increase the number at will, and the decryption speed is not affected.
2. Compile the so file:
$ Phpize
$./Configure
$ Make
If this error occurs, it is because Autoconf is not installed:
$ Make
Make: *** no targets specified and no makefile found. Stop.
3. Install the so file. Compile the file in the modules directory and copy it to the location where PHP extension is stored, such as/usr/lib/PhP5/20060613 + LFS, then in PHP. added in ini:
Extension = php_scresponso
4. Compile the executable file used to encrypt the file:
$ CD tools
$ Make
The newly generated screw under the tools directory can be called after it is put in $ path. For example, to encrypt a file:
$ Screw a. php
Success crypting (A. php)
The encrypted A. php file runs normally. At the same time, screw will change the unencrypted file to the. Screw file as a backup.
Find./-name "*. php"-print | xargs-N1 screw // encrypt all. php files
Find./-name "*. Screw"-print | xargs-N1 RM // Delete the backup files of all. php source files
Update @ 2008-09-01
After encryption, there is still a small problem. Use require or include reference to put the encryption under include_path.CodeIs cited as plaintext. There are two solutions:
Use the absolute path to reference the encrypted content stored in include_path. If it is your host, it will certainly be okay;
Reference using relative paths, such as in the sub-directory of the project.
PS: Several Problems Encountered during compilation are as follows (solution)
1. /Root/php_screw-1.5/php_scresponc: In function 'pm9screw _ compile_file ':
Solution:
You need to modify php_screw.c
Set org_compile_file (file_handle, type) in line 78, 84, and 93 );
To:
Org_compile_file (file_handle, type tsrmls_cc );
Then make will be successful.
2.
/Opt/soft/php_screw-1.5/php_scresponc: In Function
'Zm _ startup_php_screw':/opt/soft/php_screw-1.5/php_screw.c: 124:
Error: 'zend _ compiler_globals' is not named 'Extended _ info'
Member/opt/soft/php_screw-1.5/php_scresponc: In Function
'Zm _ shutdown_php_screw':/opt/soft/php_screw-1.5/php_screw.c: 133:
Error: 'zend _ compiler_globals' does not have the 'Extended _ info' member make :***
[Php_screw.lo] Error 1
Solution:
You need to modify php_screw.c
Set CG (extended_info) to 1;
To:
CG (compiler_options) | = zend_compile_extended_info;
From: http://phprs.info/thread-23300-1-1.html