php代码怎么加密最好,不能破解的那种?
作者:smallsnails
链接:https://www.zhihu.com/question/41355445/answer/40600388971
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
链接:https://www.zhihu.com/question/41355445/answer/40600388971
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
1、加密软件
- Zend Guard:https://www.zend.com/downloads
- ionCube PHP Encoder:https://www.ioncube.com/
- Swoole Compiler:https://business.swoole.com/
- PHP Screw:https://github.com/Luavis/php-screw
- PHP Screw plus:https://github.com/del-xiong/screw-plus
- PHP Beast:https://github.com/liexusong/php-beast
2、安装php-beast扩展
【注】当前php版本:7.4.33
2.1、安装依赖或软件
# yum -y install gcc gcc-c++ autoconf automake make
# yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
yum -y install zip unzip
2.2、下载
wget https://github.com/liexusong/php-beast/archive/master.zip
2.3、解压
unzip master.zip
2.4、切换目录
cd php-beast-master
2.5、配置、编译、安装
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
2.6、修改php.ini文件
# vi /usr/local/php/etc/php.ini
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/";
extension="beast.so";
2.7、使用php -m查看
php -m | grep beast
2.8、创建目录和文件
创建目录:
mkdir -p /root/test/{source,destination}
创建文件:
<?php
// 文件路径: /root/test/source/hello.php
echo 'hello';
2.9、修改php-beast配置文件
php-beast-master/tools/configure.ini文件内容:
; source path
src_path = "/root/test/source"
; destination path
dst_path = "/root/test/destination"
; expire time
expire = ""
; encrypt type
encrypt_type = "DES"
2.10、执行加密命令
/usr/local/php/bin/php tools/encode_files.php
2.11、查看文件
# 加密前的文件
cat /root/test/source/hello.php
# 加密后的文件
cat /root/test/destination/hello.php
2.12、执行命令
# 加密前的文件
/usr/local/php/bin/php /root/test/source/hello.php
# 加密后的文件
/usr/local/php/bin/php /root/test/destination/hello.php