You are here: Home / Debian GNU/Linux / Servers / PHP / Install Zend Optimizer on Debian

Install Zend Optimizer on Debian

by Pierre-Yves Landuré last modified Oct 21, 2012 11:26

Zend Optimizer speed up PHP execution and enable the use of Zend Guard protected files. This guide help you install this PHP extension on Debian.

This howto is tested on:

  • Debian 6.0 Squeeze

Prerequisite

This howto need a working PHP setup such as, for example, the one in described by Install PHP-FPM on Debian.

Parameters

Provide the number of the version you wish to install (you can find the last version number in the Zend Guard and Zend Optimizer downloads page) :

VERSION="3.3.9"

Installation

Detect the system architecture :

ARCH=$(command dpkg --print-architecture)
if [ "${ARCH}" = "amd64" ]; then
  ARCH="x86_64"
fi

Download the software :

command wget "http://downloads.zend.com/optimizer/${VERSION}/ZendOptimizer-${VERSION}-linux-glibc23-${ARCH}.tar.gz" \
    --output-document="/tmp/ZendOptimizer-${VERSION}.tar.gz"

Extract the downloaded archive :

command tar --directory '/tmp' -xzf "/tmp/ZendOptimizer-${VERSION}.tar.gz"

Copy the extension binary to the PHP install :

command mkdir --parent '/usr/lib/php5/20060613/'
command cp "/tmp/ZendOptimizer-${VERSION}-linux-glibc23-${ARCH}/data/5_2_x_comp/ZendOptimizer.so" \
           '/usr/lib/php5/20060613/'

Add the extension to the PHP configuration :

command echo "zend_extension=/usr/lib/php5/20060613/ZendOptimizer.so" \
    | command tee '/etc/php5/conf.d/ZendOptimizer.ini'

Reload the configuration :

test -x /etc/init.d/php5-fpm && /etc/init.d/php5-fpm restart
test -x /etc/init.d/apache2 && /etc/init.d/apache2 force-reload
test -x /etc/init.d/lighttpd && /etc/init.d/lighttpd force-reload
test -x /etc/init.d/nginx && /etc/init.d/nginx force-reload

Thankx