PHP 5.4 安装eAccelerator加速器

下载

http://eaccelerator.net/

# cd /usr/local/src
# wget https://github.com/eaccelerator/eaccelerator/tarball/master

重命名

# mv master eaccelerator-eaccelerator-42067ac.tar.gz

解压缩

# tar zxvf eaccelerator-eaccelerator-42067ac.tar.gz
# cd eaccelerator-eaccelerator-42067ac

加载phpize

# /usr/local/php/bin/phpize

配置

# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config

安装

# make
 # make install

安装完成会提示

Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/

修改php.ini,添加如下内容

[eaccelerator]
extension="eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

然后重启apache或者php-fpm,查看phpinfo页面是否加载成功