返回列表 发新帖
查看: 705|回复: 0

[经验] Windows下的PHP 5.3.x安装 Zend Guard Loader 方法

[复制链接]

6673

热度

1万

元宝

262

贡献

管理员

DZ专员

发表于 2014-12-15 14:31:17 | 显示全部楼层 |阅读模式
[color=rgb(69, 69, 69)]从PHP5.3开始如果要支持ZendGuard加密的PHP代码,必须安装Zend Guard Loader,老的zend optimizer将不被支持。本文介绍在工作中为Linux安装Zend Guard Loader支持的过程。
[color=rgb(69, 69, 69)]  操作系统为CentOS5.5,PHP版本为5.3.8(CentOS5.5中的PHP默认版本较低,如果要升级到PHP最新版,可以使用remi的report源进行升级)。
[color=rgb(69, 69, 69)]  Windows 下面的 Zend Guard Loader 不支持php5.3.8 VC9 x86 Thread Safe而,php5.3.8  VC9 x86 Non Thread Safe 又不支持 apache。所以安装的话,就需要安装在iis或者和nginx搭配。
[color=rgb(95, 95, 95)]确实需要非线程安全版本的PHP才能安装 zend guard loader,我亲自试过的。好像在网上看到过安全版本PHP安装方法,不过配置不是下面的了。
[color=rgb(69, 69, 69)]PHP 5.3.X 开始 Zend Optimizer 正式被 Zend Guard Loader 取代了。但是安装方法有所不同,那么我就来给大家介绍下怎么安装 Zend Guard Loader 吧。
[color=rgb(69, 69, 69)]Zend Guard Loader (Runtime for PHP 5.3) 5.5.0
[color=rgb(69, 69, 69)]下载地址:http://downloads.zend.com/guard/5.1.0EA/ZendGuardLoader-php-5.3-Windows.zip
[color=rgb(69, 69, 69)]下载好后解压压缩包,找到 ZendGuardLoader-php-5.3-Windows\ZendServer\lib\loader\php-5.3.x 目录下的 ZendLoader.dll 文件,将它放到你的php目录下ext下,再编辑php.ini文件,添加一段代码(如):
[color=rgb(69, 69, 69)][Zend.loader]
zend_loader.enable=1
zend_loader.disable_licensing=1
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
zend_extension="F:/web/PHP/ext/ZendLoader.dll"
[color=rgb(69, 69, 69)]最后我们来测试下安装是否成功,重启IIS,用php探针来查看或者用 <?php phpinfo(); ?>
[color=rgb(95, 95, 95)]php5.3起要安装FASTCGI下载地址:http://www.iis.net/download/FastCGI
[color=rgb(69, 69, 69)]最新Windouws版下载地址:phphttp://windows.php.net/download/

[color=rgb(69, 69, 69)]============================
[color=rgb(69, 69, 69)]linux下安装方法:
[color=rgb(69, 69, 69)]1、从Zend.com下载最新的Linux操作系统系下的Zend Guard Loader:本文用的是x86-64位的,下载的文件为:ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
[color=rgb(69, 69, 69)]  2、上传至Linux服务器并解压缩,注意阅读生成目录下的README文件。全文如下(添加必要的注释)。在/etc/php.d/目录下创建文件zend.ini,内容如下:
[color=rgb(95, 95, 95)]zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
[color=rgb(69, 69, 69)]  注意路径一定要写上,刚开始没写路径,老是加载不上ZendGuardLoader.so,也可以直接将上面的配置写入/etc/php.ini文件中,效果一样。
[color=rgb(69, 69, 69)]  3、重启httpd服务:service httpd restart。
[color=rgb(69, 69, 69)]  4.http://IP/test.php(内容为<?php phpinfo(); ?>),看到如下内容及证明安装成功了。

[color=rgb(69, 69, 69)]  注意:with Zend Guard Loader v3.3出现表示安装成功,如果没有则安装失败。
[color=rgb(69, 69, 69)]  5、其他的可选配置,可以参考下面的README文件。

返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|草根吧