Install php encryption and decryption tool php_screw-1.5 under CentOS

Source: Internet
Author: User
Friends who have used the php_screw tool in the past must like it very much. However, since php_screw-1.5.tar.gz is the last version, it is no longer updated, and the old version cannot be used in php5.3 or later versions. After modifying the source code, you can use the modified version in php5.3 or later versions. Test Environment: centos6.5php5.6apahche2.4.10

Friends who have used the php_screw tool in the past must like it very much. But since the last versionThe php_screw-1.5.tar.gz is no longer updated, and the old version cannot be used in php5.3 or later versions. After modifying the source code, you can use the modified version in php5.3 or later versions.

Test environment centos 6.5 php5.6 apahche2.4.10

Test procedure:

1. download the latest php_screw-1.5_php5.3.tgz version through the following link

Http://download.csdn.net/detail/fengxupeng1979/8776279

 

2. tar zxvf php_screw-1.5_php5.3.tgz

3. enter the decompressed directory.

4. run the phpize command.

5 ../configure

6. make

7.Copy the php_scresponso file under the modules directory to the php extension directory.

8. edit the php. ini file.
Add the following statement to the php. ini file:
Extension = php_scresponso

9.Restart Apache
/Srv/apache/bin/apachectl restart
8. Compile the encryption tool
Cd tools
Make
9. copy the tool screw used for encryption under the tools directory to the appropriate directory.
Cp screw/usr/bin/

 

Usage:

1. vim test. php creates a php file. For example:

[Php]View plaincopy
  1. Phpinfo ();
  2. ?>

 

2. execute screw test. php to put the generated encrypted file into the webpage directory and access it through a browser to check whether the file is normal.

If the encrypted test. php file is not generated, check the screw permission settings chmod 755/usr/bin/screw.

3. batch processing script files can encrypt the files in the entire directory at one time.

The content of the cryptphp. sh file is as follows:

[Plain]View plaincopy
  1. #! /Bin/sh
  2. DATE = 'date + % Y % m % d % H % M'
  3. Tar czf $ {DATE} bak. tgz $1
  4. Find $1-name "*. php"-print | xargs-n1 screw
  5. Find $1-name "*. screw"-print | xargs-n1 rm-v

 

4. after adding executable permissions, encrypt your code.

 

Ps: Tested php5.3 and later versions are completely available. However, in the spirit of php open source, I hope you can share more code and exchange more. So that everyone can be improved. Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.