linux中安裝Zend Optimizer與eAccelerator教程

來源:互聯網
上載者:User


下載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

添加資訊如下:

[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版本即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.