How to install Zendoptimizer in Linux

The Zend Guard Loader is a PHP extension that runs PHP scripts encoded by Zend Guard. The Guard Loader extension must be installed on each Web server that runs files that were encoded with, or use, Zend Guard licenses. The Zend Guard Loader translates encoded files to a format that can be parsed by the Zend Engine. This runtime process uses the Zend engine as a trigger to start the Zend Guard Loader component.

This article contains the detailed steps to install Zend loader.

Step 1 – Login to your server via ssh

Step 2 – Check what version of php is running on your server.

# php -v

Step 3 – Register in the link http://www.zend.com/en/products/guard/downloads and copy the direct download url for Zend Guard package appropiate to the version of PHP you have and type of operating system your server has (it is Linux but whether it is 32-bit or 64-bit).

Step 4 – Use wget command to grab the Zend loader package

# wget direct-download-link

Step 5 – Now extract it using tar command

# tar xzvf name-of-package-file.tar.gz

Step 6 – Enter the the new folder extracted and find the ZendGuardLoader.so file.

# cd name-of-package-file

Step 7 – Copy ZendGuardLoader.so file to the apropriate location given below

for 32-bit server: /usr/lib/php/modules
for 64-bit server: /usr/lib64/php/modules

Step 8 – Create ZendGuard.ini file inside /etc/php.d directory

# vi /etc/php.d/ZendGuard.ini

Step 9 – Add corresponding lines inside that file as given below

For 32 bit server,

; Enable Zend Guard extension
zend_extension=/usr/lib/php/modules/ZendGuardLoader.so
zend_loader.enable=1

For 64 bit server,

; Enable Zend Guard extension
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
zend_loader.enable=1

Step 10 – Restart Apache service

# service httpd restart

You can verify the configuration by using php -v command.
Note: If you also wanted to install IonCube PHP Loader, make sure to load it before Zend guard Loader (Ioncube loader first then Zend loader). Otherwise it may return error.

Leave a Reply

Your email address will not be published. Required fields are marked *