eAccelerator is a further development from mmcache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated.
-
Prior to installing check that php-devel package is installed.
Download via http://eaccelerator.net/Downlo
Run the below commands to compile and configure:
# export PHP_PREFIX="/usr" # $PHP_PREFIX/bin/phpize # ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config # make
Run `make install` to install the application.Note:
You must specify the real prefix where PHP is installed in the "export" command. It may be "/usr", "/usr/local", or something else. You can find out by running `which phpize`.If you get - "You should update your 'aclocal.m4' by running aclocal." when you run phpize, then you should run `aclocal`.
The "eaccelerator.so" shared extension gets installed in /usr/lib/php4 directory.
Copy the "eaccelerator.ini" to the "/etc/php.d" directory and modify the default values as needed.
If php has not been configured with "--with-config-file-scan-dir=/
zend_extension="/usr/lib/php4/Create the cache directory and change the owner to the user that apache runs as:eaccelerator.so" eaccelerator.shm_size="64" eaccelerator.cache_dir="/tmp/e accelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="3600" eaccelerator.shm_prune_period= "0" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9 eaccelerator.admin.name="youru sername" eaccelerator.admin.password="y ourpassword"
# mkdir /tmp/eaccelerator # chown apache /tmp/eaccelerator # chmod 0700 /tmp/eacceleratoreAccelerator can be managed through web interface script eaccelerator.php. Copy the eaccelerator.php and eaccelerator_password.php file in the eaccelerator directory to a directory that is web-accessible. For security reasons it is recommended to restrict the usage of this script by your local IP. Before you can access the eaccelerator.php page, you will need to create the eAccelerator admin username and password for it:
# php -q eaccelerator_password.php
Add the given output admin name and password to the "/etc/php.d/eaccelerator.ini" file.
Restart Apache.Verify installation is working by cheking with a phpinfo file. The contents of the phpinfo file should show similar information mentioning eAccelerator:
This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies with eAccelerator v0.9.2, Copyright (c) 2004-2005 eAccelerator, by eAccelerator
- sandip's blog
- Login or register to post comments
Comments
Easiest install would be to use dags/rpmforge repo.
Install via:
# yum install php-eaccelerator
If you get the below error on running phpize:
aclocal: command not found
You need to install automake via:
# yum install automake
The autoconf package is needed if you get the below error while running `$PHP_PREFIX/bin/phpize`:
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
Installation via:
# yum install autoconf
Recently updated eaccelerator to 0.9.5, everything seems to be the same with the installation steps mentioned above, except that you now specify the "allowed_admin_path" for scripts that you allow to get admin information and do admin controls in the "/etc/php.d/eaccelerator.ini" file.
eaccelerator.allowed_admin_pat h = "/var/www/html/control.ph p"
Once that is set, you can copy the "control.php" file to your webroot and access the admin control page to get detail information. Make sure to change the default admin user and password in the "control.php" file.
Also note: every time php is updated, eaccelerator need to be re-compiled and installed.
A trackback to the eAccelerator project contributor - blog.zoeloelip.be !
I did some eAccelerator benchmarks, and was quite impressed. You can view the results at Programmin' Prim8.
Can the shm_size setting be greater than the maximum size of a shared memory segment?
In my system (redhat) that value is 32 MB
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
______________________________ _
Can I set shm_size to 64 MB no prob?
Yes, it will get multiple shm-segments if it does not fit in one shared memory segment.