eAccelerator Building from Scratch

apt-get install php-dev

cd /tmp

wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2

tar xfj eaccelerator-0.9.6.1.tar.bz2

cd eaccelerator-0.9.6.1

phpize

./configure

make

sudo checkinstall

Successfully compiled, built and installed on Ubuntu Maverick:

**********************************************************************

  Done. The new package has been installed and saved to

 /tmp/eaccelerator-0.9.6.1/eaccelerator_0.9.6.1-1_i386.deb

 You can remove it from your system anytime using: 

      dpkg -r eaccelerator

**********************************************************************

Enable eAccelerator in PHP

The configuration files for the PHP 5 modules are stored in the /etc/php5/conf.d directory. So we create the file /etc/php5/conf.d/eaccelerator.ini.

sudo nano /etc/php5/conf.d/eaccelerator.ini

Add the following lines to /etc/php.d/eaccelerator.ini or /etc/php5/conf.d/eaccelerator.ini :

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"

As you see, we are using the disk cache directory /var/cache/eaccelerator which we must create now and make it world-writable:

sudo mkdir -p /var/cache/eaccelerator
sudo chmod 0777 /var/cache/eaccelerator

Restart Apache so that our new PHP configuration takes effect:

sudo service apache2 restart

Further Documentation


CategorySoftware

eAccelerator (last edited 2011-04-06 12:27:13 by 150)