Friday, September 24, 2010

Installing eAccelerator in linux machine

Follow the steps to install eAccelerator in linux machine

#cd /usr/local/
#wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6-rc1.tar.bz2
#tar -jxvf eaccelerator-0.9.6-rc1.tar.bz2
#cd /usr/local/eaccelerator-0.9.6-rc1/
#phpize
#./configure
#make
#make install

To find the absulute path for php.ini file we use the following command

# php -i | grep ini

After locating the php.ini file edit the file in the following way

# 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="path/where/eaccelerator.so/is/located/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 http service

#/etc/init.d/httpd restart

test the installation using

Testink

#php -v

You should be getting a output like

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

That's it, you have installed eAccelerator on the server

No comments:

Post a Comment

(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })()