Adding extensions to Zend Server

For my translator tool for Zend Framework, I needed the pspell extension to add a spell checker to the tool and I also wanted to test the PHP SVN extension. Unfortunately, pspell and svn are not included by default in Zend Server. There are 2 ways to add it to Zend Server: using Zend Server sources or using PECL. I followed the below instructions to install them on my Ubuntu 8.10.

Installing PSPELL via Zend Server sources

First of all, as suggested by Jess comment (see below), you have to check the availability of differents packages to compile a PHP extension:

autoconf -V | grep '^autoconf'
#autoconf (GNU Autoconf) 2.61
automake --version | grep '^automake'
#automake (GNU automake) 1.10.1
gcc --version | grep '^gcc'
#gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2

Second: Aspell and languages that you want to check:

apt-get install aspell libaspell-dev aspell-en aspell-fr ...

Third: pspell library:

apt-get install libpspell-dev

Fourth: retrieve Zend Server sources (in my case PE Edition but you can do the same with CE Edition by replacing ‘pe’ with ‘ce’):

apt-get install php-source-zend-pe

Fifth: configure and compile extension (I use here the default installation directory ‘/usr/local/zend’, exchange the occurrences with your installation dir)]:

cd /usr/local/zend/share/php-source/php-5.2.9/ext/pspell
/usr/local/zend/bin/phpize
./configure --with-pspell --with-php-config=/usr/local/zend/bin/php-config
make
make install

Last: enable it in Zend Server configuration:

and check your phpinfo:

Installing SVN via PECL

Of course, you also need autoconf, automake and gcc like described above.

First: you need subversion libraries:

apt-get install subversion libsvn-dev

Second: you use PECL to install the extension, SVN is a beta extension for the moment, so you need to define explicitly the version you want. Or you can change PECL configuration:

/usr/local/zend/bin/pecl install svn-0.5.0
# or
/usr/local/zend/bin/pecl config-set preferred_state beta
/usr/local/zend/bin/pecl install svn
/usr/local/zend/bin/pecl config-set preferred_state stable

You will have 2 questions: prefix of Subversion installation and prefix of the APR installation used with Subversion. If you didn’t change them during their installation, you just have to keep autodetect.

Last: enable it in Zend Server configuration:

and check your phpinfo:

Special thanks to Remi Woler for the help and Jess Portnoy for the suggestions.

3 réflexions sur « Adding extensions to Zend Server »

  1. Hello,

    Nice post 🙂

    I have two comments:
    0. It might be worth mentioning that in order to compile PHP extensions, the following packages should be installed on the system:
    autoconf, automake, libtool and gcc
    Luckily, this packages are called the same for both Debian based systems and RHEL ones.

    1. ZendServer also includes PECL, so you can also utilize /usr/local/zend/bin/pecl to retrieve and compile PHP extensions from the PECL repository.

    Happy PHPing,

  2. Hello,

    Thanks for giving credit.

    I’d also add:
    $ libtool –version |grep « [0-9].[0-9].[0-9] »

    ltmain.sh (GNU libtool) 1.5.26 Debian 1.5.26-4 (1.1220.2.493 2008/02/01 16:58:18)

    As libtool is also essential to the process.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *