本文是在centos7.0环境下搭建的, 因为个人php是5.6版本的, 因此须要去下载对应的Zend Guard Loader。php
下载地址:linux
http://www.zend.com/en/products/loader/downloadssql
下载后解压:centos
tar zxvf zend-loader-php5.6-linux-x86_64_update1.tar.gz
将opcache.so 和 ZendGuardLoader.so 拷贝到php lib库路径下便可:ide
cp opcache.so /usr/local/php/lib/ui
cp ZendGuardLoader.so /usr/local/php/lib/centos7
接着编辑php.ini文件:spa
vi /usr/local/php/etc/php.ini3d
找到; extension=/path/to/extension/msql.so 这一行code
在下面添加如下两行:
zend_extension=/usr/local/php/lib/ZendGuardLoader.so
zend_extension=/usr/local/php/lib/opcache.so
接着在任意位置添加如下内容:
; Enables loading encoded scripts. The default value is On zend_loader.enable=1 ; 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=
此时,运行 php -v , 能够看到以下:
看到上面的“with Zend Guard Loader v3.3” , 说明安装成功了。