Wow, some of the php scripts I wrote years ago are quite inefficient. I really should rewrite them. Well, when our clients want an upgrade, I'll do it then. For now, I'm going to install eaccelerator. Luckily, it's exceedingly easy.

wget http://bart.eaccelerator.net/source/0.9.5/eaccelerator-0.9.5-rc1.zip
unzip eaccelerator-0.9.5-rc1.zip
cd eaccelerator-0.9.5-rc1

Phpize is needed to configure eaccelerator, and phpize needs autoconf so make sure you've got that.

yum install autoconf

Now to configure eaccelerator:

phpize
./configure
make
make install

Take note of where the shared lib was installed (last line of output of the the above command).

cp eaccelerator.ini /etc/php.d

Edit the above (copied) file, locate this line:
zend_extension_ts="/usr/lib/php4/eaccelerator.so"
and replace it with:

zend_extension_ts="<location you took note of above>/eaccelerator.so"

Now all that's left is to create a tmp dir for eaccelerator's cache (/tmp/eaccelerator is the default, but you can change it in the above file), and restart apache.

mkdir /tmp/eaccelerator
chown apache /tmp/eaccelerator
chgrp apache /tmp/eaccelerator
chmod 644 /tmp/eaccelerator
/sbin/service httpd restart

Test by knocking up a phpinfo.php page. At the bottom of the first section it should look something like this:

1 Response to “Installing eaccelerator for php5 on FC4”

  1. SMS Gateway Says:
    thank you for that greate article! the eaccelerator is very useful, using now on my servers too!

Leave a Reply