linux下编译安装eAccelerator和Turck MMCache
先说明eAccelerator是Turck MMCache的后续版本。。
eAccelerator不能和Turck MMCache共存。
但eAccelerator,Turck MMCache能和Zend Optimizer 共存。
MMcache已经很久没更新了,编译安装方法是和eAccelerator一摸一样的。
eAccelerator编译安装方法:
去这里下载最新版http://bart.eaccelerator.net/source/
现在最新版是eaccelerator-0.9.5.2.tar.bz2
# cd /usr/local/src
# wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
# tar jxvf eaccelerator-0.9.5.2.tar.bz2
# cd eaccelerator-0.9.5.2
# export PHP_PREFIX=”/usr/local/php4″(这里是你的php安装路径)
# $PHP_PREFIX/bin/phpize
如果到这里出现错误:
/usr/local/php4/bin/phpize: line 57: aclocal: command not found
是因为缺少了几个依赖包 autoconf 和 automake 和 libtool
装就装吧,怕它不成..
yum 在线安装autoconf 和 automake 和 libtool
yum -y install autoconf
yum -y install automake
yum -y install libtool
有的linux默认装了autoconf的,到时候自己看着办..
源码编译安装 autoconf 和 automake 和 libtool
# wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz
# tar zxvf autoconf-2.59.tar.gz
# cd autoconf-2.59
# ./configure –prefix=/usr
# make
# make install等好久呀…..终于有完了.
接下来到automake
# wget ftp://ftp.gnu.org/gnu/automake/automake-1.9.tar.gz
# tar zxvf automake-1.9.tar.gz
# cd automake-1.9
# ./configure –prefix=/usr
# make
# make install最后到 libtool
# wget ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.tar.gz
# tar zxvf libtool-1.5.tar.gz
# ./configure –prefix=/usr
# make
# make install
现在让我转回正题,接着刚才的
# cd /usr/local/src
# wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
# tar jxvf eaccelerator-0.9.5.2.tar.bz2
# cd eaccelerator-0.9.5.2
# export PHP_PREFIX=”/usr/local/php4″(这里是你的php安装路径)
# $PHP_PREFIX/bin/phpize
提示 Installing shared extensions: /usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/ (so 文件所在目录,根据你自己的系统不同的)
然后编辑PHP.INI文件
在
[Zend]
下面添加
[Zend]
extension_dir = “/usr/local/php4/lib/php/extensions” (根据自己的情况填目录)
extension=”/no-debug-non-zts-20020429/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″
Turck MMCache的是
zend_extension=”/usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so”
mmcache.shm_size=”16″
mmcache.cache_dir=”/tmp/mmcache”
mmcache.enable=”1″
mmcache.optimizer=”1″
mmcache.check_mtime=”1″
mmcache.debug=”0″
mmcache.filter=”"
mmcache.shm_max=”0″
mmcache.shm_ttl=”0″
mmcache.shm_prune_period=”0″
mmcache.shm_only=”0″
mmcache.compress=”1″
如果是装Turck MMCache的话还需要把mmcache.so复制到php.ini中的
extension_dir=/xxx 指定的目录里面。
还有就是记住:一定要在Zend下面加,而不是前~~否则会出错.
最后添加临时文件夹
# mkdir /tmp/mmcache
# chmod 0777 /tmp/mmcache
# mkdir /tmp/eaccelerator
# chmod 0777 /tmp/eaccelerator
最后重启apache
测试:
看到PHPINFO多了一条
Copyright (c) 1998-2004 Zend Technologies with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator with Zend Extension Manager v1.2.0
Created By: sb123
Form Page: linux下编译安装eAccelerator和Turck MMCache
