How to install YUM, Zend Optimizer, eAccelerator and APC

Recently a friend had difficulty installing Alternative PHP Cache (APC) and upload progress for his Drupal CMS on Debian VPS. Therefore I tought of sharing this post about how to setup and run your virtual private server with most useful PHP packages.

I would assume you have a Debian VPS, CentOs or Ubuntu and you would like to install APC, Zend Optimizer and eAccelerator for the best PHP performances or if they are required by some third party applications.

I normally like to install everything on Debian, CentOs or Ubuntu using the yum (Yellow dog Updater, Modified) package manger to make sure that updates for all applications are uniform and its easy to do, easy to search for available packages and easier to type instead of apt-get.

Most packages you might need to install on your VPS are not readily available in many yum repositories and that can be really frustrating to add every single yum repos manually. Nevertheless there is a solution to get all good things we need such as eAccelerator, GD, Image Magick, APC and Zend Optimizer and install them via yum by installing the Atomic Repository and I installed it successfully on 1&1 CentOS VPS also on Dubian box at home.

Install Atomic Repository On VPS Server:

wget -q -O - http://www.atomicorp.com/installers/atomic |sh

This command will download the atomic.sh script and then execute it and will install the Atomic GPG key. When you asked if you want to enable the Plesk yum repository if you do not have Plesk you can answer "n" otherwise if you are on 1&1 or any other hosting service with Plask you can say "y" and than select your Plask version.   If you successfully install the script you will have atomic.repo file in
/etc/yum.repos.d/
directory.

Note: YUM will be installed automatically after atomic reperitory installation and usually you do not need to install it manually.

Next I would recommend to update your YUM packages to the latest released. However this is not mandatory and you can skip from this part.

yum update


These commends will check each package version for any update or a new release avilable.

Now you should be able to install anything you like using yum install or search for most common packages.

Example:

yum search "pacakge name"
yum install "pacakge name"

Here is my A to Z experiment on one and one CentOS5 VPS

Before Zend Optimizer

  php -v

PHP 5.1.6 (cli) (built: Jul 16 2008 19:52:52)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
As you see it dose not say with Zend Optimizer.
mkdir src
cd src/
wget -q -O - http://www.atomicorp.com/installers/atomic |sh

Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-10.el5.art.noarch.rpm: OK

Would you like to add the Plesk yum repository to the system?

Enable Plesk repository? (y/n) [Default: n]:

Y

Enable Plesk 8.6 or 9.2? (8/9) [Default: 8]:

9


The Atomic Rocket Turtle archive has now been installed and configured for your system
The following channels are available:
  atomic          - [ACTIVATED] - contains the stable tree of ART packages
  atomic-testing  - [DISABLED]  - contains the testing tree of ART packages
  atomic-bleeding - [DISABLED]  - contains the development tree of ART packages

yum update

Transaction Summary
=============================================
Install     10 Package(s)
Update     147 Package(s)
Remove       0 Package(s)

Total download size: 225 M
Is this ok [y/N]:

Y

This may take a several minutes and if all goes fine you should get see “Complete!†message at last line.

yum search Zend Optimizer

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * atomic: www5.atomicorp.com base | 1.1 kB 00:00 updates | 951 B 00:00 addons | 951 B 00:00 extras | 1.1 kB 00:00 Excluding Packages from Plesk Server Administrator Finished =========== Matched: Optimizer, Zend =========== php-zend-optimizer.x86_64 : PHP Zend Optimizer ============== Matched: Optimizer ============== php-eaccelerator.x86_64 : PHP accelerator, optimizer, encoder and dynamic content cacher bcel.x86_64 : Byte Code Engineering Library ================ Matched: Zend ================= roadsend-php.x86_64 : The Roadsend PCC Compiler for PHP
[root@s15341387 src]#

  yum install php-zend-optimizer.x86_64

Transaction Summary
================================================
Install      5 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 5.8 M
Is this ok [y/N]:

  Y

Installed: php-zend-optimizer.x86_64 1:3.3.3-2.el5.art
Dependency Installed: autoconf.noarch 0:2.59-12 automake.noarch 0:1.9.6-2.1 imake.x86_64 0:1.0.2-3 php-devel.x86_64 0:5.2.9-2.el5.art
Complete!

Now the Zend Optimizer is installed and to check you can use

After Zend Optimizer installation
  php -v

PHP 5.2.9 (cli) (built: Mar 11 2009 08:22:06)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Now you can do something for eAccelerator, APC and other packages as you wish.

Share this
Anonymous's picture

This is a very good post

This is a very good post providng a lot of informative stuff on the topic. I always like to leave comments whenever I see something unusual or impressive. I think we must appreciate those who do something especial. Keep it up, thanks
Anonymous's picture

A question...

Have you ever try installing more than one of Zend Op, eA, APC and xcache? If so which ones? Id like to know it that would cause a problem or... make things better.
Iman's picture

APC + Memcached or Xcache

Yes, I am using the combination of APC and Memcache. APC and Memcached are made for different thing. APC is an opcode cache and can compile and speed up the script execution. APC depends a lot on what data is presented in single server, whereas Memcached is a distributed memory caching system and used as a data store instead of a cache.
In my experience APC as an opcode cache can help to speed-up the application execution and use Memcached for user/data store (Storageflow) to boost your application performance.
Note: About the Zend optimizer it looks like PHP5.3 doesn’t like the optimizer anymore and there is a major incompatibilities.
I found a good link about caching with Memcached and APC http://www.slideshare.net/benramsey/caching-with-memcached-and-apc