CentOS 5.3 64位安装 php-eAccelerator

安装之前应确保系统里已经安装如下组件:
yum -y install php-devel
yum -y install autoconf
yum -y install automake
yum -y install libtool

然后 去这里http://bart.eaccelerator.net/source 下载 eaccelerator最新版。本文用的是:eaccelerator-0.9.5.3
unzip  eaccelerator-0.9.5.3.zip解压
进入这个目录 然后输入:phpize 回车,如果没有错误就可以开始编译了。

./configure
make
make install

完成之后会有如下提示: Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20060613/

记住这个路径,下面会用。

编辑php.ini 如果装了zend路径会有变化。。
加如下面的其中一个,,有两种运行方式一种PHP  一种zend任选其一

php extension

extension=”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″

Zend extension

zend_extension=”/usr/lib64/php4/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″

重启apache:service httpd restart

创建eaccelerator.cache_dir=”/tmp/eaccelerator”这个目录

mkdir /tmp/eaccelerator

chmod 0777 /tmp/eaccelerator

测试eaccelerator是不是已经工作:php -v 如果出现下面的信息就说明已经正常工作了:

Copyright (c) 1997-2009 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies

with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

可以用网页来管理eAccelerator:
将eaccelerator安装目录下的control.php 复制到你的网页根目录也可以改成你喜欢的名字,编辑修改管理帐号密码:
/** config **/
$user = “banyue.net”;
$pw = “eAccelerator”;
修改php.ini加上:
eaccelerator.allowed_admin_path = “/var/www/html/banyue.net”(这个目录是你上传的目录)
最后service httpd restart  完工。好运!

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>