I’m using eAccelerator on two servers now, for both I’m using DirectAdmin as control panel. One is based on Ubuntu and the other one is running on Cent-OS.
Download eAccelerator from their website and follow their instructions (you need root access to install eAccelerator and it’s required to install php5-dev tools first):
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2 tar xjvf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1 phpize ./configure --with-php-config=/usr/local/php5/bin/php-config make
The “–with-php-config” setting is maybe not necessary, check your server for the right location.
It might be possible that you need to install the PHP dev tools first (yum install php-devel (Cent-OS or apt-get install php-dev)
before you run
If you get a message like
[eAccelerator] This build of “eAccelerator” was compiled for PHP version 5.2.14. Rebuild it for your PHP version (5.2.17) or download precompiled binaries.
you need to start over with
If all warnings/messages after running the “make test” function are gone, continue:
Open the php.ini file (in my case: /usr/local/etc/php5/cgi/php.ini) and add the following settings at the end of the file:
zend_extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/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"
The value for “zend_extension” might be different, check the location first (you get the right value after “make install” is done).
Next we need to create the cache directory:
mkdir /var/cache/eaccelerator chmod 0777 /var/cache/eaccelerator
Warning: 0777 permissions are for the lazy ones, you should use a less permitted level (if you can). This is the advice from the eAccelerator website:
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.
retstart the web server using
and your ready! Check your php configration using “phpinfo()” and check also the cache location for newly created directories.
Check the eAccelerator website for more information.
Written by Olaf Lederer.