eAccelerator与Zend Optimizer是一个加速软件了,我们可以利用它与php环境同步运行使用得php性能更好了,下面来一起看看linux中安装Zend Optimizer与eAccelerator教程.
下载Zend Optimizer:
- http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
- tar -xzvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
- cd ZendOptimizer-3.3.9-linux-glibc23-i386
- cd data
- cd 5_1_x_comp
- cp ZendOptimizer.so /usr/lib/php/modules/
修改配置文件:vim /etc/php.ini,加入如下两行:
- zend_optimizer.optimization_level=15 #启动多少优化过程
- zend_extension=/usr/lib/php/modules/ZendOptimizer.so
然后重启下httpd服务,用phpinfo()查看,发现了:
- This program makes use of the Zend Scripting Language Engine:
- Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
- with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
安装eAccelerator:
- wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
- #bzip2 -d eaccelerator-0.9.6.tar.bz2
- #tar -xvf eaccelerator-0.9.6.tar
- #cd eaccelerator-0.9.6
- #/usr/bin/phpize
- #./configure –enable-eaccelerator=shared –with-php-config=/usr/bin/php-config
- #make
- #cp modules/eaccelerator.so /usr/lib/php/modules/
- #vim /etc/php.ini --Vevb.com
添加信息如下:
- [eaccelerator]
- extension=eaccelerator.so
- eaccelerator.shm_size=64 ;此处是加速器使用的共享内存的大小
- eaccelerator.cache_dir=/tmp/eaccelerator
- eaccelerator.enable=1
- eaccelerator.optimizer=1
- eaccelerator.check_mtime=1
- eaccelerator.debug=0
- eaccelerator.log_file=/var/log/httpd/eaccelerator.log
- eaccelerator.filter=
- eaccelerator.shm_max=0
- eaccelerator.shm_ttl=0
- eaccelerator.shm_prune_period=0
- eaccelerator.shm_only=0
修改完php.ini文件后,设置一下缓存文件夹的权限.
- #mkdir /tmp/eaccelerator
- #chmod 777 /tmp/eaccelerator
然后重启httpd服务器,然后查看phpinfo(),在其中有如下记录:
- This program makes use of the Zend Scripting Language Engine:
- Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
- with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
- with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
当然也可以通过php -i|grep Zend 和php -i |grep eAccelerator查看是否已安装成功.
php版本的查看可以通过php -v查看.
好了在这里要介绍一点关于Zend Optimizer与eAccelerator安装配置也就介绍完了,本文章介绍的版本有点老了各位可以根据自己的php版本选择合适的Zend Optimizer与eAccelerator版本即可.
新闻热点
疑难解答