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.
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:
Step 2 – Check what version of php is running on your server. Do this:
you’ll see an output something like this:
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 .
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.
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 ZendGuardLoader.so file. See example below (use cd command)
Step 7 – Then copy ZendGuardLoader.so 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 ZendGuardLoader.so /usr/lib/php/modules
Step 8 – Now create ZendGuard.ini file inside /etc/php.d directory:
Step 9 – Then add following lines inside that file:
; Enable Zend Guard extension zend_extension=/usr/lib/php/modules/ZendGuardLoader.so zend_loader.enable=1
if your server is 64-bit then use:
; Enable Zend Guard extension zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so zend_loader.enable=1
example of mine:
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:
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.
Very useful and nice way to explain each and everything. 🙂
Nice one, really helpfull
Thanks for a great guide.
there is much that simple to install ioncube loader on centos 6
yum -y install https://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/atomic-release-1.0-16.el6.art.noarch.rpm
yum -y install php-ioncube-loader
Really nice, Thanx alot
Thank you very much!!! you are the best !!!! Good guide very easy!
hi and thanks for the tutorial.
I am getting this issue when I run “service httpd restart”:
starting httpd: Namevirtualhost xx.xxx.xxx.xxx:xx80 has no virtualhosts
Namevirtualhost xx.xxx.xxx.xxx:xx43 has no virtualhosts
Namevirtualhost xxx.xxx.xxx.xxx:xx43 has no virtualhosts
I did everything the post said and I first started with the ioncube installation.
I still get the message: “Please note that the following problem currently exists with the ionCube Loader installation:
The necessary zend_extension line could not be found in the configuration.”
What could I do in this case?