User:aurora > Defunct Pages > How do I ...Install eAccelerator on Ubuntu 8.04 (Debian)
Redirected from User:Aurora/EAccelerator

How do I ...Install eAccelerator on Ubuntu 8.04 (Debian)

This tutorial details installation of eAccelerator on Ubuntu 8.04 (Hardy Heron) and most Debian systems.

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

It is important to note which version of PHP you are using on your system. "eAccelerator is still under development. The latest release, 0.9.5.3, supports PHP 4 and all PHP 5 releases including 5.2. In older releases, the encoder will only work with PHP versions from the 4.x.x branch. eAccelerator will not work with any other versions of PHP."

Display PHP Information

PHP will report the relevant information about the installed version of PHP when you execute the phpinfo() function.  You will need to know what version of PHP you have installed in your system so you can load the appropriate version of eAccelerator. In order to execute this function from your machine you need to use your favorite editor to install the following file named info.php into the base directory (/var/www/):

<?php
  phpinfo();
php?>

Using your browser enter the IP address of your server via http, such as http://localhost/info.php or http://192.168.1.2/info.php or via https, such as https://192.168.1.2/info.php to display the PHP configuration of your system:

PHPINFO Basic System.png

Note the PHP version which is installed on your system.

Prerequisites

The installation of eAccelerator on Ubuntu 8.04 will require that several program packages be installed on your system.  php5-dev is required to get the program phpize.  make is required for the program make.  Note that if you already have these packages installed on your system there is no harm in running the following commands as they will only confirm that the packages are already installed.

sudo apt-get install php5-dev
sudo apt-get install make

Install eAccelerator

Get the latest version of the eAccelerator from the eAccelerator Project.  Note that different versions of eAccelerator may or may not be compatible with your version of PHP.  Be sure to match the correct eAccelerator with your version of PHP.  With Ubuntu 8.04 it will be assumed that you are using PHP 5.2.x so eAccelerator 0.9.5.3 has been selected for installation.

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

Now edit /etc/php5/apache2/php.ini and add the following line at the beginning of the file after the [PHP] tag:

[PHP]

; eAccelerator configuration
; Note that eAccelerator may also be installed as a PHP extension or as a zend_extension
; If you are using a thread safe build of PHP you must use
; zend_extension_ts instead of zend_extension
;extension                       = "/usr/lib/php5/20060613+lfs/eaccelerator.so"
zend_extension                  = "/usr/lib/php5/20060613+lfs/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"
eaccelerator.allowed_admin_path = "/var/www/eaccelerator"

NOTE:  If you install Zend Optimizer and/or ionCube Loader you should be sure that ionCube loads before Zend Optimizer and eAccelerator installs before both for proper operation of all three extensions.

[PHP]

; eAccelerator configuration
; Note that eAccelerator may also be installed as a PHP extension or as a zend_extension
; If you are using a thread safe build of PHP you must use
; zend_extension_ts instead of zend_extension
;extension                       = "/usr/lib/php5/20060613+lfs/eaccelerator.so"
zend_extension                  = "/usr/lib/php5/20060613+lfs/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"
eaccelerator.allowed_admin_path = "/var/www/eaccelerator"

; ionCube Loader configuration
zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.2.so

; Zend Optimizer configuration
zend_extension=/usr/local/lib/Zend/ZendOptimizer.so
zend_optimizer.optimization_level=15

Create and change permissions of the eAccelerator cache directory

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

Restart Apache

sudo /etc/init.d/apache2 restart

Reload the info.php file that you created above in your browser you should now see that eAccelerator is mentioned in a box below the PHP Information on the page.  The box should look something like this:

info-php with eAccelerator.png

eAccelerator has now been successully installed.

Further down on the same page is a summary of the configuration for eAccelerator verifying the setup.

info-php eAccelerator.png

Go to top

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