To install eAccelerator, use the following command sequence;
wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2
tar -xjf eaccelerator-0.9.6-rc1.tar.bz2 -C /usr/local/
cd /usr/local/eaccelerator-0.9.6-rc1/
phpize
./configure
make && make install
To install the shared extensions:
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/
To search for the absolute path of the php.ini file
php -i | grep ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Then edit php.ini file
vi /usr/local/lib/php.ini
;
; make sure this option is uncommented
; extension_dir = "./" < <<
; so it looks like this:
;
extension_dir = "/"
;
; Then add the configuration like :
;
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/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"
Make the cache directory
mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator/
Restart Apache
/etc/init.d/apache restart
or
service apache restart
or
[ root: ~ ]# /usr/local/apache2/bin/apachectl stop
[ root: ~ ]# /usr/local/apache2/bin/apachectl start
Testink
php -v
PHP 5.3.0 (cli) (built: Nov 1 2009 22:38:48)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
with eAccelerator v0.9.6-rc1, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
or you can use phpinfo.php and check this out in web browser. Create the php.info file in the account directory or www/public_html root folder using vi/m or nano
vi /usr/local/apache2/htdocs/info.php
#
# Add this line:
#
< ?php
phpinfo();
?>
you should see the eAccelerator info
“with eAccelerator v0.9.6-rc1, Copyright (c) 2004-2007 eAccelerator, by eAccelerator” in the phpinfo.php under the Zend extension section.