After trying eAccelerator and finding out how great and simple it is, I decided to write a quick guide to show you how to install eAccelerator for PHP. If you are unsure on what eAccelerator is, you can view my post describing what it does and how it can drastically improve your website page generation speed.
Step 1 – Pre-requisites
Now to begin installing eAccelerator for php, make sure you have php4 or php5 installed along with autoconf, automake, libtool and m4. Running the below command appeared to installs these programs for me without any issues but ymmv.
apt-get install libtool m4 php5-dev make
If you get the error phpize command not found then make sure you installed php5-dev. It will also install automake and autoconf which are all required to install eAccelerator.
Step 2 – Get the latest version of eAccelerator
Download the latest version from the offical eAccelerator website and extract the contents to a folder such as your home directory and then CD to the extracted folder.
Step 3 – Building and install eAccelerator
Next step is to Install eAccelerator On Debian Linux. In order to do so, run the following commands commands. If you get any errors such as command not found, then ensure you have followed step 1
phpize ./configure make
Pay attention to any output to make sure there are no errors before running the command:
Step 4 – Edit your php.ini
Add the following lines to your php.ini file. Your php.ini is usually under /etc/php5/apache2/php.ini. You can run the php command “” to see where your php.ini file is located.
extension="eaccelerator.so" eaccelerator.shm_size="16" eaccelerator.cache_dir="/tmp/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"
Step 5 – Create the cache directory and restart apache2
Create the cache directories. This is were your compiled scripts will be held. My apache user is www-data so replace www-data with the user your apache is run under.
mkdir /tmp/eaccelerator chown www-data.www-data /tmp/eaccelerator chmod 0744 /tmp/eaccelerator apache2ctl graceful
Step 6 – Check the installation
Check to make sure eAccelerator is installed and running by executing the php function “” and scroll down to the modules section and look for eAccelerator.