你的位置: Kiyo'Space首页 服务器 阅读文章 欢迎留下您的足迹

CentOS 安装 Zend Optimizer和eAccelerator

[ 服务器 ] 分享

1.安装Zend

cd /usr/local/src
mkdir zend
cd zend
wget http://downloads.zend.com/optimizer/3.3.0a/ZendOptimizer-3.3.0a-linux-glibc23-i386.tar.gz
(64位版本对应以下链接http://downloads.zend.com/optimizer/3.3.0a/ZendOptimizer-3.3.0a-linux-glibc23-x86_64.tar.gz)
tar -xzvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.3.0a-linux-*
./install.sh

==========================================================

新的Zend Optimizer 3.3.9没有安装脚本,只能按照以下方法安装。

1. 下载文件源文件:
x86:
wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

x64:
wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

2. 解压缩下载的文件包(x86):
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

3. cd ZendOptimizer-3.3.9-linux-glibc23-i386

这里要注意,进入data文件夹后,so文件是对应版本的,看好系统中的PHP版本再安装。

4. 把 ZendOptimizer.so 文件拷贝到 /usr/local/Zend/lib
cp ZendOptimizer.so /usr/local/Zend/lib

5. 把下列两行加入php.ini,不要加入任何空格和制表符

zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so

6. 重启apache
/usr/sbin/service httpd restart

2.安装eAccelerator

yum install autoconf
yum install automake

cd /usr/local/src
mkdir eAccelerator
cd eAccelerator
wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
tar -xvjf eaccelerator-0.9.6.tar.bz2
cd eaccelerator-0.9.6
export PHP_PREFIX=”/usr/local”
$PHP_PREFIX/bin/phpize
./configure -enable-eaccelerator=shared -with-php-config=$PHP_PREFIX/bin/php-config
make && make install
cd /tmp
mkdir eaccelerator
chmod 0777 eaccelerator

编辑 php.ini

cd /usr/local/lib
vi php.ini

在[Zend]上面加

[eaccelerator]
zend_extension=”/usr/local/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″

#重启apache

service httpd restart

php -v查看结果

没有评论

  • (Required)
  • (Required, will not be published)