![2449059-433f7bd316a9d80c.png](https://i-blog.csdnimg.cn/blog_migrate/a5cb8b9c6933d919308486a24ae39cdd.webp?x-image-process=image/format,png)
php-beast.png
前言
首先说说为什么要用PHP-Beast?
有时候我们的代码会放到代理商上, 所以很有可能代码被盗取,或者我们写了一个商业系统而且不希望代码开源,所以这时候就需要加密我们的代码。
另外PHP-Beast是完全免费和开源的, 当其不能完成满足你的需求时, 可以修改其代码而满足你的要。
编译安装如下
注意:如果你需要使用,首先修改key。可以参考下文
Linux编译安装:
$ wget https://github.com/liexusong/php-beast/archive/master.zip
$ unzip master.zip
$ cd php-beast-master
$ phpize
$ ./configure
$ sudo make && make install
编译好之后修改php.ini配置文件, 加入配置项: extension=beast.so, 重启php-fpm 。
配置项:
beast.cache_size = size
beast.log_file = "path_to_log"
beast.log_user = "user"
beast.enable = On
beast.log_level支持参数:
1. DEBUG
2. NOTICE
3. ERROR
支持的模块有:
1. AES
2. DES
3. Base64
通过测试环境:
Nginx + Fastcgi + (PHP-5.2.x ~ PHP-7.1.x)
怎么加密你的项目
加密方案1:
安装完 php-beast 后可以使用 tools 目录下的 encode_files.php 来加密你的项目。使用 encode_files.php 之前先修改 tools 目录下的 configure.ini 文件,如下:
<