首页 > PHP教程 > php开发知识文章

php加速扩展eAccelerator

eAccelerator是php的一个扩展,可以将php做预编译,加快php的效率

ubuntu下安装方法:
 
eAccelerator官方下载最新版的源码包:eaccelerator-0.9.5-beta.tar.bz2

#tar -zxvf ./eaccelerator-0.9.5-beta2.tar.bz2

#cd eaccelerator-0.9.5-beta2

#export PHP_PREFIX="/usr/local" (把PHP安装目录导入到环境变量,默认是/usr/local)

#$PHP_PREFIX/bin/phpize

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

#make

#make install

 

#make the configure for the php

#edit the file php.ini,add the following lines;

extension="eaccelerator.so"

eaccelerator.shm_size="16"

eaccelerator.cache_dir="/etc/php5/eaccelerator_tmp"

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"

 

#make the tmp dir in the previous step

sudo mkdir /etc/php5/eaccelerator_tmp

sudo chmod 777 /etc/php5/eaccelerator_tmp

 

#restart the apache

sudo service apache2 restart

 

#check out the eAccelerator; find the section for eAccelerator in the phpinfo page;

关闭
感谢您的支持,我会继续努力!
扫码打赏,建议金额1-10元


提醒:打赏金额将直接进入对方账号,无法退款,请您谨慎操作。