Installing Zend Optimizer on Linux-distributions
(checked 01.26.2010 on i386) Zend Optimizer is an application that enables PHP to run scripts encoded by Zend Encoder and Zend SafeGuard Suite.
This software is not included into repositories of popular operating systems, such as CentOS and Debian Linux. The article below describes how to install it.
Downloading Zend Optimizer package
Download the package at http://www.zend.com/ (go to the the Download section). You are supposed to be registered, however you may use a direct address to download the file.
Log in to the server via SSH and execute the command:
For 32-bit operating systems (i386/i686)
For 64-bit architecture (x86_64/amd64)
You can learn your server’s architecture and operating system by executing uname -a and viewing /etc/redhat-release (for CentOS) or /etc/debian_version (for Debian correspondingly)
# uname -a Linux example.com 2.6.18-128.2.1.el5.028stab064.8ent #1 SMP Sat Oct 31 11:32:49 MSK 2009 i686 i686 i386 GNU/Linux # cat /etc/redhat-release CentOS release 5.4 (Final)
In this case, CentOS 5.4 with i386 architecture will be installed on the server.
Installing on CentOS 5.4
# tar xzvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
Learn the PHP version installed on your server:
# php -v PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05)
We have PHP 5.1.6. The archive has modules for different versions.
Copy and paste the module into any of the directories. I would recommend that you copy it to all other modules, in this case to /usr/lib/php/modules/
# cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_1_x_comp/ZendOptimizer.so /usr/lib/php/modules/
Edit /etc/php.ini and add the record below to upload the module:
# service httpd restart
Installing on Debian 5.0
Install the software in the same way as on CentOS Linux
Find out the PHP version
# php -v PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009 22:16:23) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Copy the module into the directory with PHP modules
# cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php5/
Debian Linux has different configuration files for PHP modes. In our case these files are as follows:
/etc/php5/apache2/php.ini /etc/php5/cgi/php.ini /etc/php5/cli/php.ini
You can create one file not to add a zend_extension line to all the files
Restart the web-server:
# /etc/init.d/apache2 restart
Once the installation is complete, proceed to verification.
Run php -m to make sure that the module is uploading.
# php -m ... [Zend Modules] Zend Optimizer
Execute the php -i command to leran the information about PHP
# php -i | grep Zend Zend Extension => 220051025 Zend Memory Manager => enabled This program makes use of the Zend Scripting Language Engine: Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies Zend Optimizer Zend Loader => enabled
or execute the phpinfo code on the site
<? phpinfo(); ?>
If you have any troubles, you may use any of the zend encoded testfile, for example, Zend developers offer encoded.zip that has files encoded with Zend. If it is missing, “component “Zend Optimizer” is not installed” will display.