CentOS, Tips and Tricks

Installing Zend Optimizer with IonCube Loader

Zend Optimizer and Ioncube, can safely be installed on an InterWorx server. Ref: http://www.interworx.com/faq/general

To install Zend Optimizer.

cd /usr/src/
wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
tar xzf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

Now locate php.ini and extension directory. To locate php.ini, run following command:

php -i |grep php.ini

You will get a similar output.

Configuration File (php.ini) Path /etc/php-cgi.ini

Now locate extension_dir using following command:

grep extension_dir /etc/php-cgi.ini

Copy Zend extension to php extension dir using following command:

cp /usr/src/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php5/

Then add following line to /etc/php.d/ioncube.ini

zend_extension = /usr/lib/php5/ZendOptimizer.so

Then restart web server.

Please note that if you add above line to /etc/php-cgi.ini, you will get following error:

-bash-3.00# php -v
PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

Hope this helps

Leave a Reply