Installing Zend Optimizer
From ISPWiki
Contents |
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 a 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)
# wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
For 64-bit architecture (x86_64/amd64)
# wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
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
Unpack ZendOptimizer upon download:
# 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 the required module to 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 line below to upload the module:
zend_extension=/usr/lib/php/modules/ZendOptimizer.so
Restart Apache:
# 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
/etc/php5/conf.d/zend.ini
add
zend_extension=/usr/lib/php5/ZendOptimizer.so
Restart the web-server:
# /etc/init.d/apache2 restart
Once the installation is complete, proceed to verification.
Verification
Run php -m to make sure that the module is being uploaded.
# php -m ... [Zend Modules] Zend Optimizer
You can also view the information about PHP with the php -i command
# 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 by executing 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.
