MindTouch Developer Center > Deki > FAQ > Performance Tuning > How do I...Install eAccelerator for PHP?

How do I...Install eAccelerator for PHP?

Table of contents
No headers

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.

          

This is based on the following instructions: 

http://eaccelerator.net/wiki/InstallFromSource 

Aurora also put together instructions for Debian and Ubuntu

  

Install php development package (to get phpize)

RHEL/CentOS/Fedora

yum install php-devel

Debian/Ubuntu

apt-get install php5-dev

Download and compile eAccelerator

wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2 
tar xvjf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
phpize
./configure --enable-eaccelerator=shared
make
make install

           

Add the following to your php.ini:

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/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"

Create eAccelerator temp dir

mkdir -p /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator

Restart Apache

RedHat/CentOS/Fedora

service restart httpd

Debian/Ubuntu

/etc/init.d/apache2 restart

Verify eAccel is enabled by checking phpinfo()

echo "<?php phpinfo(); ?>" > /var/www/dekiwiki/skins/phpinfo.php

Then visit http://yourwiki/skins/phpinfo.php in a browser.

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2