How to Install Zend Guard Loader

In this tutorial, we'll show you how to install Zend Guard Loader on your server. Zend Guard Loader is an extension that makes it possible to use PHP files encoded with Zend Guard, a tool used by some proprietary PHP applications to protect access to the app's source code.

Currently, Zend Guard Loader only supports PHP 5.5 and 5.6. It does not yet support PHP 7.0 and no longer supports PHP 5.4.

Download and Transfer to Your Server

Zend Guard Loader can only be downloaded while logged in to your Zend account. You cannot directly download it to your server. So, you'll need to download the .tar.gz file and then SFTP it to your server.

You can download Zend Guard Loader from here. Be sure to download the Linux 64-bit loader for the version of PHP your app is using. The filename will look like zend-loader-php5.X-linux-x86_64.tar.gz.

Once downloaded, use your server's root account to SFTP the .tar.gz file to your server.

Extract and Configure

Next, SSH in to your server as root and run the following commands for the PHP version you're using.

PHP 5.5

tar xzf zend-loader-php5.5-linux-x86_64.tar.gz
cd zend-loader-php5.5-linux-x86_64
sudo cp /opt/sp/php5.5/lib/php/extensions/no-debug-non-zts-20121212/
sudo cp /opt/sp/php5.5/lib/php/extensions/no-debug-non-zts-20121212/
sudo replace -- /etc/php5.5-sp/conf.d/opcache.ini
sudo bash -c 'echo "zend_extension=/opt/sp/php5.5/lib/php/extensions/no-debug-non-zts-20121212/" > /etc/php5.5-sp/conf.d/zendguardloader.ini'
sudo service php5.5-fpm-sp restart

PHP 5.6

tar xzf zend-loader-php5.6-linux-x86_64.tar.gz
cd zend-loader-php5.6-linux-x86_64
sudo cp /opt/sp/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
sudo cp /opt/sp/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
sudo replace -- /etc/php5.6-sp/conf.d/opcache.ini
sudo bash -c 'echo "zend_extension=/opt/sp/php5.6/lib/php/extensions/no-debug-non-zts-20131226/" > /etc/php5.6-sp/conf.d/zendguardloader.ini'
sudo service php5.6-fpm-sp restart

Verify Zend Guard Loader Is Enabled

Run the following command to verify Zend Guard Loader is enabled:

php5.6-sp -i | grep "Zend Guard Loader"

The output should look like this:

with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
Zend Guard Loader
Zend Guard Loader => enabled

Uninstalling the Zend Guard Loader Extension

To uninstall this extension, as root run the command:

sudo rm /etc/phpX.Y-sp/conf.d/zendguardloader.ini

Next, restart PHP-FPM with the command:

sudo service phpX.Y-fpm-sp restart

Last updated: February 26, 2018