How To: Eaccelerator!

koh

Verified User
Joined
Dec 3, 2005
Messages
142
Location
Singapore
Okay, I got quite abit of error when I try to install eaccelerator for the first time.
Since I manage to successfully clear everything up, I
m writing a How-To here so the rest who want to install have no problem doing it, this has been tested on CentOS4.2 w/ PHP5.0.5 :D

Eaccelerator is is a PHP accelerator/caching utility that is based on of the old mmcache which has been discontinued long ago,.

#Create a folder for Eaccelerator

mkdir Eaccelerator

cd Eaccelerator

#Download the installation

wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2

tar -xvjf eaccelerator-0.9.4-rc1.tar.bz2

cd eaccelerator-0.9.4-rc1

# Installation Steps
export PHP_PREFIX="/usr/local"

$PHP_PREFIX/bin/phpize
(Note that you need phpize, automake, autoconf and libtools installed)

./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config

make

make install

#Now we create the directory to store the cache.

cd /tmp

mkdir eaccelerator

chmod 0777 eaccelerator


Now it should be installed, so we will proceed to edit the php.ini, please take note that there is 2 version here, with or without zend.

# Without Zend

nano /etc/php.ini

Search for
;Directory in which the loadable extensions (modules) reside.

extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"

# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory

Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...

extension="eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/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"


# With Zend

nano /usr/local/Zend/etc/php.ini

Search for
;Directory in which the loadable extensions (modules) reside.

extension_dir = "/usr/local/lib/php/extensions/eaccelerator/"

# and change the dir according to what you get after make install, or you can use locate eaccelerator.so to check the directory

Search for ;Windows Extensions, if you don't know how, press Ctrl+W and add...

zend_extension="/usr/local/lib/php4/eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/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"

Save and Exit

service httpd restart

Thats all!

Problem1-

Unable to increase shm_size to more than 32mb.

# It is most probably because you are on kernel2.6, the standard shared memory is only 32mb, to increase it to (for example) 64mb we will have to do this.

echo 6710864 > /proc/sys/kernel/shmmax

then go to /etc/sysctl.conf and add this line so that it will remember the new value.

kernel.shmmax=6710864

save and exit, restart the httpd

service httpd restart

now check your phpinfo again.
 
Last edited:
eAccelerator is a fork of MMCache (was TurckMMCache). Both are extensions for PHP which provide an opcode cache and encoder. eAccelerator is free and open source.

After PHP compiles a script into a list of opcodes, eAccelerator optimizes those opcodes, and then caches the compiled list to shared memory or disk. Upon subsequent accesses to the script, this optimized and precompiled list is loaded, to avoid the compilation penalty.

eAccelerator also provides certain functions[1] for use in PHP scripts which allow access to shared memory, automatic web (content) caching, and other related tasks.

The encoder is very similar to the proprietary Zend Encoder software, which also creates a file that cannot be as easily read as a normal PHP script. An extension named eLoader is also available to execute such encoded scripts if the eAccelerator extension is not desired.

taken from: http://en.wikipedia.org/wiki/EAccelerator

Basically it cached your script, lessen your server load and sorta accelerate it.
 
Last edited:
Won't it do the same as the Zend optimiser ?

Is there a performance increase when installing it on a zend optimizer enabled setup ?
 
I've moved this thread to 3rd Party Software as it's not a How-To until/unless it's a step by step way to do something that works :) .

Jeff
 
netswitch said:
Won't it do the same as the Zend optimiser ?

Is there a performance increase when installing it on a zend optimizer enabled setup ?

It can actually work together with zend optimizer, and yes it turn out better :)
 
it is a lot faster and effective then zend optimiser, I now only use zend optimiser for the zend loader and use eaccellerator for optimisation.
 
agreed , this program make page load 4 to 6 times faster
 
Last edited:
phpize, automake, autoconf, where can I find these, I've searched on the net, but can't realy find something that is usefull.
 
done that then it says this ==>

-bash-3.00# $PHP_PREFIX/bin/phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
 
Just done this ==>

./configure --prefix=/usr &&
make &&
make install

Doesn't helps. It does install alot but at the end it says ==>

make: *** [install] Error 1

At that time I was in the directory==>

/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix
 
The_cobra666 said:
Just done this ==>

./configure --prefix=/usr &&
make &&
make install

Doesn't helps. It does install alot but at the end it says ==>

make: *** [install] Error 1

At that time I was in the directory==>

/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix

The error is the exit code from make, but what caused the error is somewhere above that line, but not pasted here.

My guess is some sort of permissions error or perhaps something didn't get built, and the install failed to find that file. You might want to redirect the output of make to a file and inspect it to see what is failing. I would also redirect stderr to stdout too, so the errors should be near where they occured in the output.

I have no idea why would be in an ncftp directory, that has nothing to do with eaccelerator.
 
it happen to me as well, so I re-install autoconf, autoinstall etc, but there is no gurantee it willwork
 
toml said:
The error is the exit code from make, but what caused the error is somewhere above that line, but not pasted here.

My guess is some sort of permissions error or perhaps something didn't get built, and the install failed to find that file. You might want to redirect the output of make to a file and inspect it to see what is failing. I would also redirect stderr to stdout too, so the errors should be near where they occured in the output.

I have no idea why would be in an ncftp directory, that has nothing to do with eaccelerator.

How do you reinstall it?
 
-bash-3.00# cd /usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/
-bash-3.00# make install
( cd ncftp ; make "CC=gcc" "CFLAGS=-D_LARGEFILE64_SOURCE -g -O2" )
make[1]: Entering directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/ncftp'
Done making NcFTP.
make[1]: Leaving directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/ncftp'
( cd sh_util ; make "CC=gcc" "CFLAGS=-D_LARGEFILE64_SOURCE -g -O2" )
make[1]: Entering directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/sh_util'
Done making NcFTP shell utilities.
make[1]: Leaving directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/sh_util'
( cd vis ; make "CC=gcc" "CFLAGS=-D_LARGEFILE64_SOURCE -g -O2" )
make[1]: Entering directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/vis'
Done making NcFTP full-screen utilities.
make[1]: Leaving directory `/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/vis'
mkdir "/us" "/us/bin" "/us/man" "/us/man/man1" 2>/dev/null
make: [install] Error 1 (ignored)
..... Installing the manual pages .....
/usr/bin/install -c -m 644 doc/man/ncftp.1 "/us/man/man1/ncftp.1"
/usr/bin/install -c -m 644 doc/man/ncftpget.1 "/us/man/man1/ncftpget.1"
/usr/bin/install -c -m 644 doc/man/ncftpput.1 "/us/man/man1/ncftpput.1"
/usr/bin/install -c -m 644 doc/man/ncftpbatch.1 "/us/man/man1/ncftpbatch.1"
/usr/bin/install -c -m 644 doc/man/ncftpls.1 "/us/man/man1/ncftpls.1"
-rw-r--r-- 1 root root 33124 Feb 2 18:24 /us/man/man1/ncftp.1
-rw-r--r-- 1 root root 1831 Feb 2 18:24 /us/man/man1/ncftpbatch.1
-rw-r--r-- 1 root root 6670 Feb 2 18:24 /us/man/man1/ncftpget.1
-rw-r--r-- 1 root root 2785 Feb 2 18:24 /us/man/man1/ncftpls.1
-rw-r--r-- 1 root root 6487 Feb 2 18:24 /us/man/man1/ncftpput.1
..... Installing the programs .....
/usr/bin/install -c bin/ncftp "/us/bin/ncftp"
/usr/bin/install -c bin/ncftpget "/us/bin/ncftpget"
/usr/bin/install -c bin/ncftpput "/us/bin/ncftpput"
/usr/bin/install -c bin/ncftpls "/us/bin/ncftpls"
/usr/bin/install -c bin/ncftpbatch "/us/bin/ncftpbatch"
-rwxr-xr-x 1 root root 184432 Feb 2 18:24 /us/bin/ncftp
-rwxr-xr-x 1 root root 107216 Feb 2 18:24 /us/bin/ncftpbatch
-rwxr-xr-x 1 root root 106588 Feb 2 18:24 /us/bin/ncftpget
-rwxr-xr-x 1 root root 100880 Feb 2 18:24 /us/bin/ncftpls
-rwxr-xr-x 1 root root 106588 Feb 2 18:24 /us/bin/ncftpput
(The following will fail if you didn't build the curses-based programs.)
/usr/bin/install -c bin/ncftpbookmarks "/us/bin/ncftpbookmarks"
/usr/bin/install: cannot stat `bin/ncftpbookmarks': No such file or directory
make: *** [install] Error 1

Then I tried this ==>


-bash-3.00# make autoconf
make: Nothing to be done for `autoconf'.

Search for autoconf ==>

-bash-3.00# locate autoconf
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
/usr/include/linux/autoconf.h
/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/autoconf
/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/autoconf/acconfig.h
/usr/local/directadmin/scripts/packages/ncftp-3.0.2.fix/autoconf/aclocal.m4
/usr/local/directadmin/customapache/php-4.4.0/ext/mysql/libmysql/ctype_autoconf.c
 
cause it's the only directory I can find anything of the autconf like the locate showed in my previeus post. If I need to be in a different directory tell me. Cause If I login to the ssh and are in the root and then do make install, nothing happens.
 
Back
Top