How to install eAccelerator


eAccelerator
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.

eAccelerator was born in December 2004 as a fork of the Turck MMCache project. Turck MMCache was created by Dmitry Stogov and much of the eAccelerator code is still based on his work.

eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks only for a short time, while searching for a compiled PHP script in the cache, so one script can be executed simultaneously by several engines. Files that can't fit in shared memory are cached on disk only. "

NOTE: Please read this page as a reference before continuing on. It may help, some references might relate to Ubuntu Linux.

How to Install eAccelerator for PHP 5 with Apache 2

First download eAccelerator.

Uncompress the files:

tar xjvf eaccelerator-x.x.x.x.tar.bz2

Go into the directory you just uncompressed to and run phpize:

phpize

Configure:

./configure

Building the files:

make

Install the files

sudo makeinstall

After that, it should tell you a line similar to this "/usr/lib/php5/20063994/eaccelerator.so". Copy and paste it into a empty document or remember it.

Now you have load it up, so open the "php.ini" config file.

sudo nano /etc/php5/apache2/php.ini

Add this to the end of the the document but it has to be above the other zend_extensions:

zend_extension="/usr/lib/php5/xxxxxxxx/eaccelerator.so" 
eaccelerator.shm_size="0"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path=""

Has its own admin frontend .php file to it, read doc if you want to know more.

Make a directory for eAccelerator to cache its files.

sudo mkdir /var/cache/eaccelerator

Set directory permissions for Apache 2:

sudo chown www-data:www-data /var/cache/eaccelerator

Now your done, restart Apache 2.

sudo /etc/init.d/apache2 restart
    To see if its loaded successfully:
  • Create a file called phpinfo.php
  • Inside it, have
    <?php phpinfo(); ?>
  • Upload it to the server
  • Using your web browser, browse http://yoursite/phpinfo.php

It should have:
"Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator"

Notes:
If you have Zend Optimizer / eAccelerator / Ioncube Loader installed, then its best to put the extension string in PHP config file in this order.

eAccelerator > Ioncube Loader > Zend Optimizer

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post PHP code. You should include <?php ?> tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _____    __     ____    ____  
|___ | / /_ |___ \ |___ \
/ / | '_ \ __) | __) |
/ / | (_) | / __/ / __/
/_/ \___/ |_____| |_____|
Enter the code depicted in ASCII art style.