Many of today’s best open-source CMS systems are written with PHP, an incredibly popular and powerful scripting language. PHP’s power lies in its ability to dynamically generate pages, eliminating the need to code pages by hand in HTML. However, that same dynamism is one of the chief disadvantages of PHP because of the processor power needed to generate pages on the fly. Thankfully, that disadvantage can be easily mitigated by using caching programs like eAccelerator.
So what’s eAccelerator? Here’s the official description from eAccelerator.net:
eAccelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
I’ve found the 1-10 times speed increase to be a conservative estimate as many PHP sites will gain even more speed—even more reason to install this awesome software package.
Below I’ve outlined the process which I followed to install eAccelerator on a Media Temple dedicated virtual (dv) server version 3.5 running CentOS 5 and Plesk Control Panel version 8.6. Your setup my differ substantially, so please read through the documentation on the eAccelerator website and consult your hosting provider before proceeding.
Media Temple customers should visit their servers admin menu within the Media Temple Account Center in order to install the developer tools on your server as several of the software packages included in the developer tools will be needed for this installation, including “make” and “gcc.” This process will take a few minutes, so go grab a cup of coffee.
To begin the actual install process, login to your server via SSH using Terminal if you’re using a Mac or an SSH client like Putty if you’re using a PC. Here’s a quick guide to linux command-line commands if you need a reference.
Once you’re logged, drop back to the root directory:
cd /
Next, you’ll need to create a directory for eAccelerator, and then navigate into that directory:
mkdir /ea/
cd /ea/
Download and unzip the installer:
wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2
bzip2 -d eaccelerator-0.9.5.3.tar.bz2
tar xvf eaccelerator-0.9.5.3.tar
Set your current directory to the unzipped file:
cd eaccelerator-0.9.5.3
When you have only one php install (check your server settings), it’s safe to run these commands in the source directory. This next series of commands will configure and install eAccelerator:
phpize
./configure
make
make test
make install
After compilation, there should be a “eaccelerator.so” file in the modules subdirectory of the eAccelerator source directory. Check to make sure this is present.
Next, copy the eaccelerator.ini file into the /etc/php.d/ directory:
cd /
cp /ea/eaccelerator-0.9.5.3/eaccelerator.ini /etc/php.d/eaccelerator.ini
Edit eaccelerator.ini using the text editor:
vi /etc/php.d/eaccelerator.ini
Now change this uncommented line:
zend_extension=”/usr/lib/php4/eaccelerator.so”
To this :
zend_extension=”/usr/lib/php/modules/eaccelerator.so”
Now, restart Apache:
service httpd restart
To Verify that this installation worked, first check out PHP:
php -v
You should see these lines somewhere in the mix:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
Finally, you can create a php file, and drop this line into it:
<?php phpinfo(); ?>
When you load this php file in your browser you should see the configuration information from your installing of PHP and eAccelerator will have added its own block of information. It will show the configuration, but also the amount of allocated memory, cached scripts and so on. When this says that eaccelerator is enabled and any number of scripts are cached, eAccelerator is working.
If you have any questions about eAccelerator or anything else we’ve covered on ReadyMadeWeb, please leave a comment or email us at info@readymadeweb.com.


