Choose the preferable version and install it:
- Code: Select all
cd /usr/local/src
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
bzip2 -d eaccelerator-0.9.5.2.tar.bz2
tar xvf eaccelerator-0.9.5.2.tar
cd eaccelerator-0.9.5.2
Check if all needed modules presented in the system:
- * apache >= 1.3,
* mod_php >= 4.1,
* autoconf,
* automake,
* libtool,
* m4
Sometimes php-devel package needed, because phpize function is used to compile php:
- Code: Select all
yum install php-devel
whereis phpize
Commonly it`s in /usr/bin/phpize.
In this situation we should do following:
- Code: Select all
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure
--enable-eaccelerator=shared
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install
Obtain location of php.ini (default /etc/php.ini) and add following lines:
- 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"
- 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"
- Code: Select all
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
Finally, restart Apache service:
- Code: Select all
service httpd restart