1.安装:
$git clone https://git.oschina.net/splot/php-screw-plus.git
$cd php-screw-plus
$phpize
$./configure --with-php-config=/usr/local/php/bin/php-config
2.先设置key,在编译:
打开php_screw_plus.h,修改 #define CAKEY "..." 里面的值,比如:7SgmRHrSTDZt
$ vim php_screw_plus.h
$ make
重新编译需:
$make clean
$make
3.进入tools目录:
cd tools/
make
4. 修改php配置文件:
$vim php/etc/php.ini
$extension=路径/php_screw_plus.so
重启php
5.实际使用:
加密:在扩展的tools目录,执行./screw [路径],[路径]可以是单个文件也可以是文件夹
解密:在扩展的tools目录,执行./screw [路径] 加参数 -d
6.screw plus阻止执行未经许可的php文件。
$ vim php_screw_plus.h
把STRICT_MODE后面的值改为1,然后
make clean && make
重启php