- mkdir -p /usr/local/src/eAccelerator
- cd /usr/local/src/eAccelerator
- wget http://dpvps.googlecode.com/files/eaccelerator-0.9.6.tar.bz2
- tar jxvf eaccelerator-0.9.6.tar.bz2
- cd eaccelerator-0.9.6/
- php -i|grep php.ini #查看php.ini路径
-
- [root@baiqiuyi eaccelerator-0.9.6]# php -v
- PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29)
- Copyright (c) 1997-2010 The PHP Group
- Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
- with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
- with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
- [root@p1 eaccelerator-0.9.6]# php -i|grep '/usr/local/etc/php5/cgi/php.ini'
- Loaded Configuration File => /usr/local/etc/php5/cgi/php.ini
- [root@p1 eaccelerator-0.9.6]# export PHP_PREFIX="/usr/local"
- [root@p1 eaccelerator-0.9.6]# $PHP_PREFIX/php5/bin/phpize
- Configuring for:
- PHP Api Version: 20041225
- Zend Module Api No: 20060613
- Zend Extension Api No: 220060519
-
- yum install autoconf automake -y && ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/php5/bin/php-config
-
- [root@baiqiuyi eaccelerator-0.9.6]# echo $?
- 0
- [root@baiqiuyi eaccelerator-0.9.6]# 如果输出为0
- [root@baiqiuyi eaccelerator-0.9.6]# make && make install
- [root@baiqiuyi eaccelerator-0.9.6]# vim /usr/local/etc/php5/cgi/php.ini
- 按G,再按O (大写字母O)
-
- [eaccelerator]
- zend_extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/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"
-
- 按Esc,然后 shift + zz (按住shift键,按两次小写字母z)
-
- [root@baiqiuyi eaccelerator-0.9.6]# service httpd configtest #测试配置文件
- # 输出Syntax OK的话直接
- [root@baiqiuyi eaccelerator-0.9.6]# service httpd restart
- ###注意:eAccelerator的配置文件一定要放到ZendOptimizer ioncube之类的前面,否则会报错。