PHP5.4发布至今一年多,但Zend组件(Zend Optimizer / Zend Guard Loader)却一直不支持,很多像我一样升级了PHP5.4的朋友跟我一样郁闷过吧,以前貌似只能重新配置PHP像我这种用LNMP之类套件的貌似只能全部重新搭建生产环境吧。最近Zend发布了Zend Guard Loader (Runtime for PHP 5.4),在PHP5.5(官方说自带支持Zend Optimizer)出来之前,我们可以很简单的有Zend组件支持PHP5.4啦,好激动啊,不纠结了,上教程:1.下载Zend Guard Loader (Runtime for PHP 5.4) 根据32位或64位选择对应的系统版本,官方下载地址:http://www.zend.com/en/products/guard/downloads
下载需要注册Zend网站的,懒得注册的直接在我这下载就可以咯:
Zend Guard Loader (Runtime for PHP 5.4) 6.0.0(32 bit)| Zend Guard Loader (Runtime for PHP 5.4) 6.0.0(64 bit)
 
2.安装 Zend Guard Loader
解压后将 ZendGuardLoader.so 上传到服务器 /usr/zend/ 目录,我的LNMP自带的有原先的PHP5.3版本的组件,替换即可;
 
3.配置 Zend Guard Loader
编辑php.ini(/usr/local/php/etc )文件,在最后位置添加以下内容:
 
[Zend Guard]
zend_extension=/usr/local/zend/ZendGuardLoader.so
; Enables loading encoded scripts. The default value is On
zend_loader.enable=1
 
4.重启
/root/lnmp restart
至此,Zend Guard Loader (Runtime for PHP 5.4)安装完成,我们可以在 phpinfo 和 探针 看到如下成功安装信息。