elix
08-08-2006, 09:09 PM
Okay, since there is apparently a lot of controversey here as to whether or not this works, I thought I'd post a tutorial....
* please note that all of the following paths are for a cpanel based VPS/server and you will need to adapt this a bit if you are doing this on plesk, da, etc.
First, let's make sure there are no ambigious eaccelerator related lines in php.ini.
grep -v eaccelerator -- /usr/local/lib/php.ini > /usr/local/lib/php.ini.new
mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak
mv /usr/local/lib/php.ini.new /usr/local/lib/php.ini
service httpd restart
php -v
(you shouldn't see eaccelerator)
edit /usr/local/lib/php.ini and search for extension_dir and change it to /usr/local/lib/php/extensions, so you have something like this:
extension_dir = "/usr/local/lib/php/extensions"
; extension_dir directive above.
; Be sure to appropriately set the extension_dir directive.
Now, install Zend Optimizer: (self explanatory installer basically)
wget http://downloads.zend.com/optimizer/3.0.1/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
tar zvfx ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.1-linux-glibc21-i386
./install
Now, compile eaccelerator:
wget http://easynews.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4.tar.bz2
tar jvfx eaccelerator-0.9.4.tar.bz2
cd eaccelerator-0.9.4
/usr/local/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
make
make install
mv /usr/local/lib/php/extensions/no-debug-non-zts-*/eaccelerator.so /usr/local/lib/php/extensions
edit /usr/local/lib/php.ini and add the following to the bottom:
;;eAccelerator
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/php-cache"
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="0"
create /php-cache
mkdir /php-cache; chmod 0777 /php-cache
restart apache
service httpd restart
There...finished, and if you have any problems, you have /usr/local/lib/php.ini.bak
* please note that all of the following paths are for a cpanel based VPS/server and you will need to adapt this a bit if you are doing this on plesk, da, etc.
First, let's make sure there are no ambigious eaccelerator related lines in php.ini.
grep -v eaccelerator -- /usr/local/lib/php.ini > /usr/local/lib/php.ini.new
mv /usr/local/lib/php.ini /usr/local/lib/php.ini.bak
mv /usr/local/lib/php.ini.new /usr/local/lib/php.ini
service httpd restart
php -v
(you shouldn't see eaccelerator)
edit /usr/local/lib/php.ini and search for extension_dir and change it to /usr/local/lib/php/extensions, so you have something like this:
extension_dir = "/usr/local/lib/php/extensions"
; extension_dir directive above.
; Be sure to appropriately set the extension_dir directive.
Now, install Zend Optimizer: (self explanatory installer basically)
wget http://downloads.zend.com/optimizer/3.0.1/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
tar zvfx ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.1-linux-glibc21-i386
./install
Now, compile eaccelerator:
wget http://easynews.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4.tar.bz2
tar jvfx eaccelerator-0.9.4.tar.bz2
cd eaccelerator-0.9.4
/usr/local/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
make
make install
mv /usr/local/lib/php/extensions/no-debug-non-zts-*/eaccelerator.so /usr/local/lib/php/extensions
edit /usr/local/lib/php.ini and add the following to the bottom:
;;eAccelerator
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/php-cache"
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="0"
create /php-cache
mkdir /php-cache; chmod 0777 /php-cache
restart apache
service httpd restart
There...finished, and if you have any problems, you have /usr/local/lib/php.ini.bak