創建目錄:
mkdir /tmp/eaccelerator
chmod -R 0777 /tmp/eaccelerator
解壓:
wget http://ncu.dl.sourceforge.net/project/eaccelerator/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
cp control.php /網站跟目錄/control.php
執行:
/usr/local/php/bin/phpize
如果出現找不到autoconf的提示,就裝一個 yum install -y autoconf
編譯:
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make
make install
修改php.ini在最後加入以下配置,注意,zend_extension可以先通過查找eaccelerator.so得到你的正確路徑,eaccelerator.allowed_admin_path也要替換爲你真實的網站control.php被放置的目錄:
zend_extension="/usr/lib/php5/20090626+lfs/eaccelerator.so"
eaccelerator.shm_size="16"
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"
eaccelerator.allowed_admin_path="/var/www/control.php"
重啓apache,安裝完成