I’m currently getting my LAMP stack overhauled to get more performance out of it. So I start to get eaccelerator into the php5. This is not installable via aptitude, and therefore I just give you the instructions how to install and enable it.

First we need to install the necessary build tools with:

apt-get install build-essential php5-dev

Next step we need to download the latest version of eaccelerator:

cd /usr/src
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar xvjf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
phpize
./configure
make
make install
mkdir -p /var/cache/eaccelerator
chmod 1777 /var/cache/eaccelerator

Now we have installed the module, we now have to get it activated in php5. We add the configuration to the file /etc/php5/conf.d/eaccelerator.ini, which is also read, when the apache2 is restarted. Here is the content of the file:

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

And now it works and gives an extra push on php script performance.