Technology of the day: Zend Server

03 September 2009 » DB2, Linux, MySQL, New York PHP, PHP, Zend

A few months back, Ed Kietlinski introduced us to the new Zend Server at a New York PHP meeting. I’ve since installed it on two of my department’s servers and put together some notes on my experience.

Update: See the comments section for some configuration suggestions from Zend that differ from the steps I followed. Jess also clarifies the difference in caching between the standard and Community Editions.

What is Zend Server?
Zend Server is a packaged version of PHP targeted at businesses that require a supported and tested stack that’s easy to install and maintain.

It also integrates the other Zend products, such as the Zend Framework, Zend Studio for debugging, Zend Caches, Zend Java Bridge, and Zend Guard/Optimizer among others.

Zend offers several variants and licensing models. There’s a Community Edition that’s free but doesn’t include the more advanced features such as caching and monitoring, there are several tiers of production support, and there are half-price development licenses.

In all cases, migration from one version to another is simply a matter of updating your license information in Zend Server’s console.

Why it interests me
Zend Server hits a sweet spot for my team, where we run only one each of development and production LAMP servers.

We don’t cluster nor do we require a job queue for our PHP applications, so the Zend Platform Enterprise Solution doesn’t fit our needs (See this comparison table).

Of course, we use plenty of WebSphere and Java for our sponsor facing applications hosted in advanced data centers that have different functional and non-functional requirements.

However, our internal department tools are supported by hybrid front-end/server-side developers that can learn and get up and productive on PHP quickly, rather than needing to know or learn Java in the same ramp up period.

In the cases where we require queuing or clustering, we look to WebSphere Application Server, rather than Zend Platform Enterprise Edition, as we do to run our Restlet/Spring Integration pseudo-ESB that integrates many of our other internal tools.

The primary attraction of Zend Server for these department servers is that it can be used as an RPM-based system that bundles the latest stable version of PHP with all the extensions that we need, including the DB2 and MySQL drivers, curl, libxml and mbstring.

Our full-time system administrator has long had to maintain custom compiled versions of PHP and Apache, but we want to move to an automated, package-managed way of doing things as he increases the volume of non-sysadmin work he has taken on.

The RPMs from CentOS repositories are traditionally a few PHP versions behind and aren’t patched frequently enough to fully rely on the operating system’s default package management system.

As I’m writing this, the most recent RPM version of PHP is 5.1.6 where the most recent version of PHP is 5.2.10 (shipped with Zend Server 4.0.4) and 5.3 (shipped with Zend Server 4.0.5).

Beyond easing maintenance for us from an installation and update perspective, Zend Server also offers a performance boost (an optimizer and cacher), monitoring features (logs, traces and event notifications), and simplified configuration (switching on and off extensions, setting directive properties) managed through its GUI Web console.

I installed Zend Server on two servers – an x86 and an x86_64 – running CentOS 5.3 using the RPM method. One is the test server; the other is a future production server that is hosting some supplemental applications now.

The production server has a tiered license provided by Zend, who is an IBM Business Partner. The development server will run a half-priced version of the license intended for test server installations.

In both cases, installation was straightforward. There are more detailed instructions available for other operating systems and package management methods.

  • My first step was to find other PHP packages on the system.
    [code lang=”bash”][root@]# rpm -qa | grep php[/code]
    And remove each one.
    [code lang=”bash”][root@]# rpm -e {package name}[/code]
    After uninstalling the PHP packages, php.ini will be backed up:
    [code lang=”bash”]/etc/php.ini saved as /etc/php.ini.rpmsave[/code]
  • Then, I installed Zend Server.
    [code lang=”bash”][root@]# tar xvzf ZendServer-4.0.4-RepositoryInstaller-linux.tar.gz
    [root@]# cd ZendServer-RepositoryInstaller-linux/
    [root@]# ./[/code]
    This script will set up your repositories, and kick off the installation process. It will stop, configure, and restart the existing Apache instance (we’ve kept that as a standard RPM).

The only additional package I needed to install that was not part of the default set was the DB2 driver. You must have a DB2 runtime client on the server at a minimum to use this.

  • Install the DB2 driver for PHP.
    [code lang=”bash”][root@]# yum install php-ibmdb2-zend-pe[/code]

A few tips
Of course, as with any PHP build, some post-installation configuration may be necessary.

I pointed out above that my existing php.ini was backed up after removing the older PHP packages. You’ll want to make sure the old and the new php.ini are functionally equivalent.

  • DB2
    For one of my servers, I didn’t have to follow any special configuration steps to get the Zend Server to interact with DB2, but the other wouldn’t load the DB2 extension at first.

    It failed with the following error.
    [code lang=”bash”]PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/zend/lib/php_extensions/’ – cannot open shared object file: No such file or directory in Unknown on line 0[/code]

    The resolution to this issue was simple, it requires you to source the DB2 environment for the Web server user. In my case, I added the following line to the /etc/init.d/httpd startup script:
    [code lang=”bash”]. /home/db2inst1/sqllib/db2profile[/code]

  • Mail
    I also had to make a small adjustment to my mail directives to point it to sendmail on my system, as described in this forum post.
    [code lang=”bash”]/usr/sbin/sendmail -t -i[/code]
  • PEAR
    The latest version of Zend Server fixes an issue with the PEAR installer, but if you are using the packaged (not tarball, version 4.0.5) version of Zend Server 4.0.4, you might want to follow the tips in this forum post.

If I run into any other issues or tips on Zend Server, I’ll post updates here.

I also hope to dig into the differences between Zend Core for IBM and Zend Server, in order to evaluate whether it’s a worthwhile cross-upgrade for my server at home that hosts this blog.

Find out more
To learn more about Zend Server from the source, check out the main product page, with pointers to the different editions, getting started tutorials and videos, and the FAQ.

The Zend Server documentation is very helpful too, including sections on best practices for performance and security.

As with Zend’s other products, they’ve also got an active forum for Zend Server.


4 Responses to 'Technology of the day: Zend Server'

Subscribe to comments with RSS

  1. Jess Portnoy said,

    06 September 2009 at 1:49 am

    Hello Daniel,

    First, thanks for the thorough review.
    I have a few small comments:
    0. You wrote “There’s a Community Edition that’s free but doesn’t include the more advanced features such as caching and monitoring..”
    While its true PageCache Zend extension is not part of the community edition [CE], the DataCache extension is included in both flavors.
    1. While it can certainly be considered good practice, you don’t have to manually remove the distribution’s PHP packages, ours declare that they obsolete the ones from the distro and so, those will be removed during the installation of the ZS ones.
    2. About sourcing /home/db2inst1/sqllib/db2profile, your method would of course work just fine, but I’d recommend sourcing it in /etc/sysconfig/httpd instead or in /etc/apache2/envvars which is the parallel in Debian/Ubuntu distributions.

    Thanks again for using ZendServer and writing this review.
    If you have more feedback, feel free to drop me a line at jess zend com.

  2. Al T. said,

    09 November 2009 at 2:24 am

    Hi Daniel,

    Ran into the same DB2 problem you encountered … “Unable to load dynamic library ‘/usr/local/zend/lib/php_extensions/’”.

    Your solution did not work for me with Zend Server on Fedora 11 … however, setting the directive “ibm_db2.instance_name” to “db2inst1”. You can do it via the Zend Server -> Extensions, scroll down to the ibm_db2 extension, then click on the directives link. This is likely the better solution. Note you need to make sure that /usr/local/zend/etc/conf.d/ibm_db2.ini is writable. Of course, you can edit the ibm_db2.ini directly if need be.

    Thanks for your article. If you hadn’t noted setting the db2inst1 profile, I would never had tried setting the ibm_db2 directive!

    Al T.

  3. Lisa said,

    05 March 2010 at 1:50 pm

    another way instead of sourcing /home/db2inst1/sqllib/db2profile is compile pdo_ibm your self

    download the pdo_ibm package form, un-compress it and “cd” into the forder.

    run forllowing command

    #./configure –with-pdo-ibm=/home/db2inst1/sqllib
    #make && make install

    will create a new pdo_ibm extension in /usr/local/zend/lib/php_extension/

    just need to restart zend server

  4. Lubos said,

    17 March 2012 at 6:08 am

    hi guys,

    just to add, in Ubuntu 11.10 you have to source it in /usr/sbin/apache2ctl

Leave a Reply