Install eAccelerator in Ubuntu

First you need to download php4-dev package which we need to compile eAccelerator

sudo apt-get install php4-dev

If you are using php5 install the following package

sudo apt-get install php5-dev

Download eAccelerator source package from here http://sourceforge.net/project/showfiles.php?group_id=122249

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

Extract the downloaded file using the following command

sudo tar jxvf eaccelerator-0.9.5.tar.bz2

cd eaccelerator-0.9.5

Running phpize creates config file which is needed in make.

sudo phpize

sudo ./configure enable-eaccelerator=shared with-php-config=/usr/bin/php-config

sudo make

sudo make install

This will complete the installation.

Now you need to Edit the file /etc/php4/apache2/php.ini for php4 users and add following lines to install php extension

sudo vi /etc/php4/apache2/php.ini

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

If you want to install as Zend extension you need to enter the following lines in /etc/php4/apache2/php.ini file

zend_extension=/usr/lib/php4/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

If you use a thread safe build of PHP you must use zend_extension_ts instead of zend_extension.

If you are using PHP5 you need to edit the /etc/php5/apache2/php.ini file

Creating cache directory

One last very important step is creating the cache directory that you configured in the previous step. The default value is /tmp/eaccelerator Its easy because its writable to everyone.

A safe bet is making it world writable. A safer and cleaner way would be to change the owner of the directory to the same user PHP runs as (most of the time the same user as Apache or Lighttpd) and set 0644 permissions

sudo mkdir /tmp/eaccelerator

sudo chmod 0777 /tmp/eaccelerator

Restart apache and youre finished with the eAccelerator configuration

#/etc/init.d/apache2 restart

Testing Your eaccelerator installation

Create test.php file with following lines on it

<? php
eaccelerator();
?>
If you have eAccelerator info shown on that page, accelerator is working fine.or you can use the following command

#php -v

HACKED BY SudoX — HACK A NICE DAY.