Here is a handy module to help speed up php sites on your server, I use this on every one of my servers.
Description:
eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
Well I dont think it speeds up 10 times but it does help.
Here is how to install
cd /usr/src
wget http://bart.eaccelerator.net/source/0.9.5/eaccelerator-0.9.5.tar.bz2
tar xjvf eaccelerator-0.9.5.tar.bz2
cd eaccelerator-0.9.5
phpize
./configure
make
make install
After you install it will show you the directory it was installed in, make sure you copy and paste this line onto your notepad, you will need it.
mkdir /phpcache
chmod 0777 /phpcache
Then edit your php.ini file
On the extension make sure you put the link you saved earlier
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20050922//eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/phpcache"
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"
Then restart apache and youre good to go. It is ideal to measure page load speed before and after installing the module. If you dont see some imprivement then you did something wrong. Occasionaly you may have to delete the cache. Also this doesnt work 100% with all scripts, it can be disabled in htaccess or vhost config.
Related Articles
No user responded in this post