Professional Documents
Culture Documents
Zend Optimizer™
User Guide
Scope
The Zend Optimizer boosts PHP performance by going over the intermediate code
generated by the standard Zend run-time compiler and optimizing it for faster execution.
In addition, it enables PHP installations to read Zend Intermediate Code files that were
encoded by the Zend Encoder™ (zendenc).
The Zend Optimizer is available for free at the Zend Store, at
http://www.zend.com/store/.
The Zend Optimizer supports the following platforms:
- Solaris®/sparc 2.6 or later
- Linux® (i386/glibc 2.1 and libc5)
- FreeBSD 3.4 or later
- Microsoft® Windows® NT 4.0, Windows 2000 and Windows XP
In addition, the Zend also provides unsupported builds of the Zend Optimizer for the
following platforms:
- Mac OSX
- OpenBSD
- Solaris/x86 2.6 or later
This guide consists of the following main sections:
• “System Requirements,” page 1
• “Installation,” page 2
• “Avoiding Incompatibilities,” page 4
• “Support,” page 4
System Requirements
The Zend Optimizer has no special system requirements, except that a compatible version
of PHP 4.x must be installed. For additional information, see “Avoiding
Incompatibilities,” page 4 or review our Product Compatibility Table
(http://www.zend.com/store/products/product_ compatibility.php).
Installation
It is recommended that after installing the Zend Optimizer you check that the installation
was successful (see “Checking for Successful Installation,” page 4).
After installation, the Zend Optimizer runs within the framework of PHP. It optimizes
your PHP scripts automatically, and transparently detects and loads encoded files.
Note: Be sure to download the Zend Optimizer version that corresponds with the
PHP version that you choose to compile. For example, the Zend Optimizer for
PHP 4.0.4 will only function with PHP 4.0.4. Otherwise, the Zend Optimizer
will not load and an error message will be displayed.
2. If you are running under Apache, restart your Apache Web server. For recent
Apache 1.3 versions, use the commands:
The unzipped files will be placed in a directory with the same name as the package
but without the .tar.gz suffix.
Copy the ZendOptimizer.so file to your system; a good place to put it is in the
directory /usr/local/Zend/lib.
3. Add the following lines to your php.ini file (usually at /usr/local/lib); do not add
any extra spaces or tabs:
zend_optimizer.optimization_level=15
zend_extension="/usr/local/Zend/lib/ZendOptimizer.so"
Note: If you do not plan on executing encoded files, disable the Optimizer's
loading feature by adding:
zend_optimizer.enable_loader = 0
Since the system’s default php and libphp.so binaries do no support dynamic
extensions, you must replace your system’s own php and libphp.so with the ones
provided in he package by executing the following commands:
mv /usr/libexec/httpd/libphp4.so /usr/libexec/httpd/libphp4.so.org
ln -s /usr/local/Zend/lib/libphp4.so /usr/libexec/httpd/libphp4.so
mv /usr/bin/php /usr/bin/php.org
ln -s /usr/local/Zend/bin/php /usr/bin/php
Windows
The part of the output where the Zend Optimizer is listed will look similar to the
following:
This program makes use of the Zend scripting language engine:
Zend Engine vX.Y.Z, copyright (c) 1998-2001, Zend Technologies Ltd.,
with the Zend Optimizer vX.Y.Z, copyright (c) 1998-2001 Zend Technologies Ltd.
Avoiding Incompatibilities
This section discusses two possible incompatibilities that have to be avoided when using
the Zend Optimizer.
Support
If you have problems or questions about the Zend Optimizer, you can use the online
Optimizer forum on Zend.com at http://www.zend.com/zend/optimizer-forum.php.
Zend SOS subscribers can also submit questions about setup and installation support
through Zend Support-Online Services (SOS). To access Zend SOS, go to the Pickup
Depot, fill in our convenient form, and click on the "Submit" button. Our worldwide team
of experts will get to work to resolve your problem. Track the status of your incident
anytime through Zend SOS.
For issues other then technical support, please email us at info@zend.com.