Install EAccelerator

eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.


#cd /usr/src/
#wget http://path/to/whereeveryou/download/eaccelerator-x.x.x.tar.gz
#tar xzvf eaccelerator-x.x.x.tar.gz

(Make sure you are going to compile it for the PHP version the site using. To confirm it create a phpinfo page in the domain and note the PHP API, PHP Extension and Zend Extension. Because these three things can be seen while compiling through shell, so you can compare if they are same or not)

#phpize
#./configure –with-php-config=/usr/bin/php-config or /usr/local/bin/php-config

(Get the correct path of “php-config” from your server according to version of PHP the domain using)

#make
#make test (–>you can check if any error is there)
#make install

(Note the extension path in the last, like /usr/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so)

Then go to php.ini, lets say “/etc/php5/php.ini”. You can get it from “php –ini” or from the phpinfo page.

#vi /etc/php5/php.ini

(Set the following in php.ini file)

zend_extension=”/usr/lib/php/extensions/no-debug-non-zts-20060613/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=”1″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

Then create eaccelerator directory and set correct permission.

#mkdir /tmp/eaccelerator
#chmod 777 /tmp/eaccelerator

Restart Apache.

#/etc/init.d/httpd stop
#/etc/init.d/httpd start

Check eaccelerator in the phpinfo page 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *