Introducing Drupal to Zend Zerver CE 5, How to

Jun 25, 2012
Julio Canadas

In this blog post I will explain how to create a guide on how to install Drupal on a Linux Server ( I choose Ubuntu 8.04 amd64 but any Linux distro will work just fine) but instead of using all the PHP packages bundled with this Linux distribution, we will be using Zend Server which is an Application Sever built for  PHP by Zend.


So, once you have set up Ubuntu, let's login as the root user typing the following command:
    
    $ sudo -s

Cool , now that we have all the privileges, let's add the Zend Server repository to our sources list by typing:
    
    # nano /etc/apt/sources.list

At the end of the file add the following lines:
    
    #Zend Server
    deb http://repos.zend.com/zend-server/deb server non-free

Save and exit.

Once we added the repository we also need to add the public key for it, we do so by typing:
    
    # wget http://repos.zend.com/deb/zend.key -O- |apt-key add -

Great, now we have added Zend Server to our package sources, we need to update our local repository by typing:
    
    # aptitude update

After updating our system we can start with the package installation, you can choose either install php version 5.2 or php version 5.3 by typing:

    # aptitude install zend-server-ce-php-5.2 (for php 5.2) or

    # aptitude install zend-server-ce-php-5.3 (for php 5.3)
    *note: this command will also install apache 2 web server automatically

For this guide we will use php v 5.2 since its the more stable version for the current Drupal release (6.x).

The commands above will install all the relevant packages for Zend Server CE but we also need some extra packages required by Drupal, we can install them by typing:

    # aptitude install php-5.2-extra-extensions-zend-server-ce

Well, that’s it, we now have successfully installed Zend Server Community Edition plus Apache 2 on our system, you can access Zend Server's Web Interface via your web browser at:
    
    https://localhost:10082/ZendServer (secure) or
    http://localhost:10081/ZendServer

To start/stop the zend server service run:
    
    $ sudo /etc/init.d/zend-server start
    $ sudo /etc/init.d/zend-server stop
    $ sudo /etc/init.d/zend-server restart

By default on Ubuntu all the files for the Zend Server will be located on your system in the next folder:

    /usr/local/zend (root folder for zend server)
    /usr/local/zend/etc/ (php.ini)
    /usr/local/zend/etc/ext.d/ (extensions config files)

Now let's configure it a little so we can expand our Drupal installation capabilities.

Drupal itself, requires a PHP extension called uploadprogress to track a file upload progress, we can easily install this extension usign Zend Server's bundled PECL installer by typing:

    # /usr/local/zend/bin/pecl install uploadprogress
    *note: to run the command above make sure you have installed on your Ubuntu a C compiler otherwise the command will fail. If not sure if there's any C compiler installed try installing first the build essentials package for Ubuntu by typing:   
    
        #  aptitude install build-essential

Once uploadprogress extension is installed, you can enable it through Zend Server's Web Interface on the extensions page.

Next, we can install APC to our system so Drupal can take advantage of this php caching system, we do so by typing:

    # aptitude install php-5.2-apc-zend-server

After installing APC we need to increase a little the default memory size of APC by editing its config file:

    # nano /usr/local/zend/etc/ext.d/apc.ini

Add this line to the end of the file:
    
    apc.shm_size="64"

Save and exit.

Awesome! You have now a robust LAMP architecture for your Drupal Projects or any other PHP application. You also may want to install Mysql on your system, do it by typing as root user:

    # aptitude install mysql-server