Okay, I got quite abit of error when I try to install eaccelerator for the first time.
Since I manage to successfully clear everything up, I
m writing a How-To here so the rest who want to install have no problem doing it, this has been tested on CentOS4.2 w/ PHP5.0.5
Eaccelerator is is a PHP accelerator/caching utility that is based on of the old mmcache which has been discontinued long ago,.
#Create a folder for Eaccelerator
mkdir Eaccelerator
cd Eaccelerator
#Download the installation
wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2
tar -xvjf eaccelerator-0.9.4-rc1.tar.bz2
cd eaccelerator-0.9.4-rc1
# Installation Steps
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
(Note that you need phpize, automake, autoconf and libtools installed)
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
#Now we create the directory to store the cache.
cd /tmp
mkdir eaccelerator
chmod 0777 eaccelerator
Now it should be installed, so we will proceed to edit the php.ini, please take note that there is 2 version here, with or without zend.
# Without Zend
nano /etc/php.ini
Search for
;Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"
# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory
Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...
extension="eaccelerator.so"
eaccelerator.shm_size="32"
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"
# With Zend
nano /usr/local/Zend/etc/php.ini
Search for
;Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"
# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory
Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...
zend_extension="/usr/local/lib/php4/eaccelerator.so"
eaccelerator.shm_size="32"
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"
Save and Exit
service httpd restart
Thats all!
Problem1-
Unable to increase shm_size to more than 32mb.
# It is most probably because you are on kernel2.6, the standard shared memory is only 32mb, to increase it to (for example) 64mb we will have to do this.
echo 6710864 > /proc/sys/kernel/shmmax
then go to /etc/sysctl.conf and add this line so that it will remember the new value.
kernel.shmmax=6710864
save and exit, restart the httpd
service httpd restart
now check your phpinfo again.
Since I manage to successfully clear everything up, I
m writing a How-To here so the rest who want to install have no problem doing it, this has been tested on CentOS4.2 w/ PHP5.0.5
Eaccelerator is is a PHP accelerator/caching utility that is based on of the old mmcache which has been discontinued long ago,.
#Create a folder for Eaccelerator
mkdir Eaccelerator
cd Eaccelerator
#Download the installation
wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2
tar -xvjf eaccelerator-0.9.4-rc1.tar.bz2
cd eaccelerator-0.9.4-rc1
# Installation Steps
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
(Note that you need phpize, automake, autoconf and libtools installed)
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
#Now we create the directory to store the cache.
cd /tmp
mkdir eaccelerator
chmod 0777 eaccelerator
Now it should be installed, so we will proceed to edit the php.ini, please take note that there is 2 version here, with or without zend.
# Without Zend
nano /etc/php.ini
Search for
;Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"
# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory
Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...
extension="eaccelerator.so"
eaccelerator.shm_size="32"
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"
# With Zend
nano /usr/local/Zend/etc/php.ini
Search for
;Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"
# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory
Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...
zend_extension="/usr/local/lib/php4/eaccelerator.so"
eaccelerator.shm_size="32"
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"
Save and Exit
service httpd restart
Thats all!
Problem1-
Unable to increase shm_size to more than 32mb.
# It is most probably because you are on kernel2.6, the standard shared memory is only 32mb, to increase it to (for example) 64mb we will have to do this.
echo 6710864 > /proc/sys/kernel/shmmax
then go to /etc/sysctl.conf and add this line so that it will remember the new value.
kernel.shmmax=6710864
save and exit, restart the httpd
service httpd restart
now check your phpinfo again.
Last edited: