git clone https://github.com/liuwanwei/buddyencrypt.git
cd buddyencrypt
phpize
./configure
make
将编译好的文件 modules/tonyenc.so 加入到配置项 extension=tonyenc.so,重启 PHP 服务
代码中的 ~/php/tonyenc.php
是加密工具:
php ~/php/tonyenc.php example.php dir/
这样即可加密 example.php
和 dir
目录下的所有 php 文件,PHP 在运行它们时会自动解密,够简单吧!