下载地址:http://sourceforge.net/projects/php-screw/
本次环境nginx+php7.0+mysql5.6
wget http://tenet.dl.sourceforge.net/project/php-screw/php-screw/1.5/php_screw-1.5.tar.gz #我用wget下载不下来,我是通过winscp工具上传到服务器的
tar -zxvf php_screw-1.5.tar.gz
cd php_screw-1.5
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make
执行make后报错:
解决:
修改php_screw.c
vim php_screw.c
修改后内容具体如下(注释没用):
在执行make && make install
执行成功后出现:Installing shared extensions: /usr/lib64/php/modules/
cd /usr/lib64/php/modules/
会出现php_screw.so
进入:/etc/php.d
下新建文件php_screw.ini
,内容如下:
;amqp extension module
extension=php_screw.so
重启php-fpm;
查看phpinfo:
进入php_screw-1.5/tools
目录下,使用make
生成screw
执行
执行命令:
[root@localhost tools]# screw /usr/share/nginx/html/xukai/index.php
Success Crypting(/usr/share/nginx/html/xukai/index.php)
php文件就加密好了
注意:加密的文件必须有<?php ?>
标签结尾,要不然加密了运行不了