Recommended VPS Complete list of best VPS hosting providers.

How to Install Zend Optimizer On CentOS 6 with Apache

How to install Zend Optimizer with Zend Guard Loader on CentOS 6 Server – In this tutorial I am using a VPS node from DigitalOcean running CentOS 6.4 32-bit as the main OS to act as Linux part in my LAMP box (Linux, Apache, MySQL and PHP). I will show you in step by step method how to install Zend Optimizer extension on your CentOS 6.x server running Apache as its main web server. For your information, Zend Guard Loader is a free runtime application that enables PHP to run the scripts encoded by Zend Guard. It can be freely used by anyone looking to run encoded applications.

What you’ll need?

A CentOS server running Apache. Read how to setup a LAMP stack on CentOS here or catch up all CentOS-related articles here.

How To

Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.

Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root.


You may also need to type this command to go to the root directory:

cd ~

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

php -v

you’ll see an output something like this:

check php version

The command above used to check which php version is running. In my case is PHP v5.3.3 or simply PHP 5.3.

Step 3 – Now you have to download 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). Go ahead grab the package from:

From there do not forget to choose Linux then pick up the one suitable with your server which in my case I have to download Zend Guard Loader 5.5 32-bit for PHP 5.3 .

download zend

You may also need to login or register for an account first. It’s free. Once the dialog box to download the needed package appears, simply copy its url to use with wget in your server.

download link

or use this shortcut:

Download URL (direct link) for Zend Guard Loader:

Zend Guard Loader (Runtime for PHP 5.4) 64-bit:

Zend Guard Loader (Runtime for PHP 5.4) 32-bit:

Zend Guard Loader (Runtime for PHP 5.3) 64-bit:

Zend Guard Loader (Runtime for PHP 5.3) 32-bit:

Step 4 – Now back to your server. Use wget command to grab the Zend loader package:




Step 5 – Now extract it using tar command:

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

In my case is:

tar xzvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz



Step 6 – Now enter the the new folder extracted and find the file. See example below (use cd command)

Step 7 – Then copy file to:

32-bit server: /usr/lib/php/modules

64-bit server: /usr/lib64/php/modules

which in my case I use 32-bit:

cp /usr/lib/php/modules


Step 8 – Now create ZendGuard.ini file inside /etc/php.d directory:

nano /etc/php.d/ZendGuard.ini

Step 9 – Then add following lines inside that file:

; Enable Zend Guard extension

if your server is 64-bit then use:

; Enable Zend Guard extension

example of mine:

zend .ini

Once done, hit Control+O to save then Control+X to exit.

Step 10 – That’s it. Now you can restart Apache service:

service httpd restart

You can check it again using php -v command and you should now see something like this:

zend loader installed

That’s it.

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.


Add a Comment

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

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.