I recently had to install Zend Optimizer for a client using a particular WordPress plugin on one of the hosting severs I run. The plugin was encoded with Zend Guard and the optimizer provides run time decoding as well as some (questionable in my opinion) performance optimizations.
All my hosting servers run Red Hat Enterprise Linux and Plesk as the hosting control panel so I set about looking up something a little more informative than Zends pathetic notes on installation. This is where I started to come a little unstuck and found myself going backwards and forwards between different sets of installations instructions and a segmentation fault problem. Now typically when I get to this point I remember that Atomic Rocket Turtle has usually not only been there and done that, they also have a installation for it and a simple yum repo waiting, as always they did. I wont detail this method as its easy to find and anyone who should be doing it will know what to do and where to look.
After installing Zend Optimizer via Atomics repo I then looked at what it had actually done, to reverse engineer the install if you like, this I hoped would leave me with a simple way to install the required module without having to add the Atomic repos to servers that are under full patch management.
So here are my simple notes.
These are based on using Red Hat Enterprise Linux 5 (or equivalent CentOS 5), PHP 5.1 (the standard PHP build for this distro) and Plesk 8.6. If you are using anything different you’ll need to adjust things in what I hope is a fairly obvious manner.
Firstly download the right Zend Optimizer package. Upload it to your server (Zend unhelpfully do not provide a direct download link) and unpack the tar ball.
Now find the right version for your version of PHP in the ‘data’ folder, for PHP 5.1 it’s in ‘5_1_x_comp’ inside will be a ‘ZendOptimizer.so’ this is the PHP module you will need to install, rename it to ‘ZendOptimizer-5.1.so’ then we will know which PHP version it’s for (Zend if you are reading this please try to follow some simple accepted standards with your naming).
In this environment PHP loads modules from ‘/usr/lib/php’ create a sub folder called ‘zend’ and copy the module into it.
Now create a file called ‘zend.ini’ in ‘/etc/php.d’ the file needs to contain the instruction to load the module ‘zend_extension=/usr/lib/php/zend/ZendOptimizer-5.1.so’.
Check things are ok with ‘php -v’ at the command line, if all is well you’ll get
PHP 5.1.6 (cli) (built: Mar 31 2010 02:44:37)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
Now restart Apache and check the Zend Optimizer module is loaded with a simple phpinfo() script and make sure that your PHP scripts and so on are all still working.
You should have now successfully installed Zend Optimizer.