ZendOptimizer+ For PHP 5.3.x

Zend Optimizer is available for php 5.3, but still no support in EasyApache. ZendGuardLoader and ZendOPtimizer are two different extensions and both of them can run Zend encoded files, but the difference is that “Optimizer” have additional opcode acceleration. ZendOptimizerPlus.so is used for PHP 5.3 encoding and is not officially released. If anyone need ZendOptimizer with PHP 5.3.x, we can install it using following steps.

1. Install p7zip

# yum install p7zipu

You may need to install RPMForge to work the above command

2. Download ZendServerCE, untar it and then unpack zend.7z:

# wget http://downloads.zend.com/zendserver/5.0.3/ZendServer-CE-php-5.3.3-5.0.3-linux-glibc23-i386.tar.gz
# tar xzvf ZendServer-CE-php-5.3.3-5.0.3-linux-glibc23-i386.tar.gz
# cd ZendServer*
# /usr/libexec/p7zip/7za e zend.7z -d zend.7z
for x64 use this file
# wget http://downloads.zend.com/zendserver/5.0.3/ZendServer-CE-php-5.3.3-5.0.3-linux-glibc23-x86_64.tar.gz

4. Now copy ZendOptimizerPlus.so to /usr/local/Zend53
mkdir /usr/local/Zend53
cp zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so /usr/local/Zend53

4.Add below code to php.ini

[zend]
zend_extension=/usr/local/Zend53/ZendOptimizerPlus.so

; Optimizer+ On/Off switch. When set to Off, code is not optimized.
zend_optimizerplus.enable=1

; If set to On, use the current directory as a part of the script key
zend_optimizerplus.use_cwd=1

; If enabled, the Optimizer+ checks the file timestamps and updates the cache accordingly.
zend_optimizerplus.validate_timestamps=1

; How often to check file timestamps for changes to the shared memory storage allocation. (units: seconds)
zend_optimizerplus.revalidate_freq=2

; Enables or disables file search in include_path optimization
zend_optimizerplus.revalidate_path=0

; The verbosity of the Optimizer+ log
zend_optimizerplus.log_verbosity_level=1

; The Optimizer+ shared memory storage size. The amount of memory for storing precompiled PHP code in Mbytes. (units: MBytes)
zend_optimizerplus.memory_consumption=64

; The maximum number of keys (scripts) in the Optimizer+ hash table
zend_optimizerplus.max_accelerated_files=2000

; The maximum percentage of “wasted” memory until a restart is scheduled (units: %)
zend_optimizerplus.max_wasted_percentage=5

; Check the cache checksum each N requests
zend_optimizerplus.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache is not being accessed (units: seconds)
zend_optimizerplus.force_restart_timeout=180

; The location of the Optimizer+ blacklist file
zend_optimizerplus.blacklist_filename=

; If enabled, a fast shutdown sequence is used for the accelerated code
zend_optimizerplus.fast_shutdown=0

; A bitmask, where each bit enables or disables the appropriate Optimizer+ passes
zend_optimizerplus.optimization_level=0xfffffbbf

; Enables or disables the optimization passes that may take significant time, based on an internal runtime calculation
zend_optimizerplus.enable_slow_optimizations=1

And finally you get Zend Optimizer installed:

[~]# php -v
PHP 5.3.10 (cli) (built: Mar 27 2012 00:14:05)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with the ionCube PHP Loader v4.0.12, Copyright (c) 2002-2011, by ionCube Ltd., and
with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: