How to install eAccelerator on linux
Now let’s download eAccelerator to a temporary directory
wget http://acelnmp.googlecode.com/files/eaccelerator-0.9.6.1.tar.bz2
Extract it:
Change the directory to eAccelerator dir:
Now let’s use PHPize to prepare a PHP extension for compiling:
./configure
Let’s install eAccelerator:
make install
eAccelerator should now be installed.
Let’s tell php to read it and start caching:
In this step, we can either create a separate file for the eaccelerator configuration or we can append them to php.ini, I will use the first method in this example.
We create the eaccelerator ini file:
and we write the following
eaccelerator.shm_size=”64″
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″
In the above example, I’m allowing eAccelerator to allocate up 64MB in memory. If you want to allow it to allocate less or more, change the value of eaccelerator.shm_size, setting it to 0 will use the default value.
Now we need to define a directory to be used for eAccelerator caching.
Let’s create a new directory:
and change permissions to read, write and execute:
Now let’s restart apache:
or
Congratulations, you now have eAccelerator installed. You can check in your phpinfo() for the eaccelerator section.
If you are unable to restart Apache server, and you receive an error, make sure your server allows you to allocate enough memory. Check this article for more details: Increase shared memory on linux (shmmax)
Follow us on facebook or twitter for the latest updates!