Sabtu, 31 Oktober 2009

Installing php eAccelerator

Installing eAccelerator- eaccelerator is  the php  assistant  to boost the php performance 

Unfortunately, there's no eAccelerator package for Debian Etch in the official repositories, therefore we must compile and install it from the sources. Before we can do this, we need to install some prerequisites:
 

apt-get install build-essential php5-dev bzip2


Now we can download and install eAccelerator like this (make sure that you get the latest version from the eAccelerator web site):

cd /tmp
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
tar xvfj eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
phpize
./configure
make

make install



eAccelerator is now installed. Now we have to tell our PHP installation that it should make use of eAccelerator. On Debian Etch, the configuration files for the various PHP 5 modules are stored in the /etc/php5/conf.d directory, and this directory is referenced in the main PHP5 configuration file /etc/php5/apache2/php.ini, meaning all files in /etc/php5/conf.d are read in whenever Apache is started/restarted. So all we do is create the file /etc/php5/conf.d/eaccelerator.ini:

vi /etc/php5/conf.d/eaccelerator.iniextension="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"


(You can read up on the various configuration settings on this page: http://www.eaccelerator.net/wiki/Settings.)

As you see, we are using the disk cache directory /var/cache/eaccelerator which we must create now and make it world-writable:

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

Afterwards, we restart Apache so that our new PHP configuration takes effect:

/etc/init.d/apache2 restart

Afterwards, open info.php again in a browser: http://webserver/info.php

You should now see eAccelerator mentioned on the page which means it has successfully been integrated and is working as expected (I've marked the eAccelerator line in the below screenshot for better visibility):

Tiada ulasan:

Catat Ulasan

Memulakan Perniagaan Cara WI-FI tiket Prabayar dengan modal hanya RM450.00

MudahSPOT hanya RM450.00. Keperluan 1) Talian Internet Streamyx/3G/WIMAX. Cuma 3G/WIMAX kurang stabil untuk perniagaan 2) Router Kerb...