EAccelerator

From ArchWiki
Revision as of 07:40, 5 June 2011 by Mandos (Talk | contribs) (Created page with "[http://eaccelerator.net/ eAccelerator] is available in [http://aur.archlinux.org/packages.php?ID=30215 AUR]. When I was writing this page the latest version was 0.9.6.1 and inst...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

eAccelerator is available in AUR. When I was writing this page the latest version was 0.9.6.1 and installation was quite easy.

Description

eAccelerator is a free open-source PHP accelerator & optimizer. 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.

Installation

Download the tarball from AUR or use your favorite tool for AUR.

Note. Make sure you use >> in the following command.

cat /etc/php/conf.d/eaccelerator.ini >> /etc/php/php.ini

Edit /etc/php/php.ini and make the following changes:

  • zlib.output_compression = On
  • cgi.fix_pathinfo=1
  • eaccelerator.cache_dir="/home/phpuser/eaccelerator/cache"

Check if installation was ok

You can either from the command line or using phpinfo(). If the command line php binary uses the same configuration file as the php-fastcgi version and/or the mod_php version, you can check it by executing:

php -v

If installation was succesfull you should see something similar to the following:

Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
   with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator

This will show eAccelerator has been loaded successfully, but this doesn't necessarily show that eAccelerator is working like it should. Load a php script running on your webserver in your browser. Assuming you didn't disable the filecache with shm_only = 1, a cached script should appear in the cache directory.

You could/should also check using phpinfo(). To do so add:

<?php
  phpinfo();
?>

to a file and open it with your browser. eAccelerator should have its own section.

Sources

Lighttpd_for_SSL_and_non-SSL#FastCGI_and_PHP_with_eAcceleration - helped me install eAccelerator and contains most of the above info and more.
eAccelerator Wiki, Settings