可能有些人会用到SHOPNC这类用Zend加密的程序,因此需要添加Zend Guard Loader,不过安装好后用探针检测,可能会出现以下情况——Zend Guard Loader旁边显示小红叉。例如安装DirectAdmin时选择PHP5.3并且选择添加Zend时,就会出现这种情况:
我们来看看Zend的官方说明文档:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
Zend Guard Loader installation instructions
-------------------------------------------
1. Extract the Zend Loader package.
2. Locate and extract the ZendGuardLoader.so (Linux) or ZendLoader.dll (Windows) that corresponds to your php version.
3. Add the following line to your php.ini file for loading the ZendGuardLoader:
Linux and Mac OS X: zend_extension=<full_path_to_ZendGuardLoader.so>
Windows non-thread safe: zend_extension=<full_path_to_ZendLoader.dll>
4. Add an aditional line to your php.ini for enabling ZendGuardLoader
; Enables loading encoded scripts. The default value is On
zend_loader.enable=1
5. Optional: following lines can be added your php.ini file for ZendGuardLoader configuration:
; Disable license checks (for performance reasons)
zend_loader.disable_licensing=0
; The Obfuscation level supported by Zend Guard Loader. The levels are detailed in the official Zend Guard Documentation. 0 - no obfuscation is enabled
zend_loader.obfuscation_level_support=3
; Path to where licensed Zend products should look for the product license. For more information on how to create a license file, see the Zend Guard User Guide
zend_loader.license_path=
6. If you use Zend debugger as well, please make sure to load it after the Zend guard Loader
7. If you use ioncube loader, please make sure to load it before Zend guard Loader
8. Restart your Web server.
|
明文说明需要添加zend_loader.enable=1,执行此命令可以检查php.ini有没有这一行代码(仅仅适合PHP-CLI/CGI,FPM的用find命令找出来后手动检查):
1
|
php -i|grep "Loaded Configuration File"|cut -d ">" -f 2-|cat|grep zend_loader.enable
|
无返回任何结果,表明php.ini并没有zend_loader.enable=1,这就难怪探针检测到Zend Guard Loader是未启用的了。
于是执行此命令加入zend_loader.enable=1到php.ini中(仅仅适合PHP-CLI/CGI,FPM的用find命令找出来后手动添加):
1
|
phpini=$(php -i|grep "Loaded Configuration File"|cut -d ">" -f 2-);echo zend_loader.enable=1>>$phpini;unset phpini
|
如果使用是PHP-FPM,就重启PHP-FPM,使用Apache的话就重启Apache。刷新后即可看到探针处ZendGuardLoader旁打上绿色小对号。
当然,官方文档里面所写到的参数不止这些,还有:
1
2
3
|
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
|
至于这些参数有什么作用且如何使用,不是本文重点,我就不为此作文章了…
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容