本文是在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」 , 說明安裝成功了。