技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁 > 教程 > 服務(wù)器類 >

linux中安裝Zend Optimizer與eAccelerator教程

來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2018-05-12 00:21┆點(diǎn)擊:

  eAccelerator與Zend Optimizer是一個(gè)加速軟件了,我們可以利用它與php環(huán)境同步運(yùn)行使用得php性能更好了,下面來一起看看linux中安裝Zend Optimizer與eAccelerator教程

  下載Zend Optimizer

  

  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 #啟動(dòng)多少優(yōu)化過程

  zend_extension=http://www.3lian.com/usr/lib/php/modules/ZendOptimizer.so

  然后重啟下httpd服務(wù),用phpinfo()查看,發(fā)現(xiàn)了

  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

  #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=http://www.3lian.com/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 ;此處是加速器使用的共享內(nèi)存的大小

  eaccelerator.cache_dir=http://www.3lian.com/tmp/eaccelerator

  eaccelerator.enable=1

  eaccelerator.optimizer=1

  eaccelerator.check_mtime=1

  eaccelerator.debug=0

  eaccelerator.log_file=http://www.3lian.com/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文件后,設(shè)置一下緩存文件夾的權(quán)限

  #mkdir /tmp/eaccelerator

  #chmod 777 /tmp/eaccelerator

  然后重啟httpd服務(wù)器,然后查看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

  當(dāng)然也可以通過php -i|grep Zend 和php -i |grep eAccelerator查看是否已安裝成功。

  php版本的查看可以通過php -v查看。

  好了在這里要介紹一點(diǎn)關(guān)于Zend Optimizer與eAccelerator安裝配置也就介紹完了,本文章介紹的版本有點(diǎn)老了各位可以根據(jù)自己的php版本選擇合適的Zend Optimizer與eAccelerator版本即可。