[文章作者:张宴 本文版本:v1.1 最后修改:2007.03.02 转载请注明出处:http://blog.zyan.cc]

  操作系统:Linux
  
  一、安装eaccelerator-0.9.5(同时支持ZendOptimizer-3.2.2)
  
  1、首先安装ZendOptimizer-3.2.2
  
  # wget http://www.vista.ac.cn/linux/down/ZendOptimizer/ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
  # tar zxvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
  # cd ZendOptimizer-3.2.2-linux-glibc21-i386
  # ./install.sh
  
  在Please specify the location for installing ZendOptimizer:提示后输入ZendOptimizer安装路径,例如/data/webserver/zend
  在Confirm the location of your php.ini file:提示后输入php.ini文件所在目录,例如/data/webserver/php/etc
  在Specify the full path to the Apache control utility (apachectl):提示输入apachectl绝对路径,例如/data/webserver/apache/bin/apachectl
  
  
  2、再安装eaccelerator-0.9.5加速软件
  
  # wget http://www.vista.ac.cn/linux/down/eaccelerator/eaccelerator-0.9.5.tar.bz2
  # tar jxvf eaccelerator-0.9.5.tar.bz2
  # cd eaccelerator-0.9.5
  
  指定php所在路径:
  # export PHP_PREFIX="/data/webserver/php"
  # $PHP_PREFIX/bin/phpize
  # ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
  # make
  # make install
  
  这时会将eaccelerator安装到php目录中,屏幕会显示eaccelerator.so所在路径,例如:
  Installing shared extensions: /data/webserver/php/lib/php/extensions/no-debug-zts-20060613/
  记住这个路径。
  
  eaccelerator即可以安装为PHP扩展,也可以安装为zend扩展,以下安装为PHP扩展。
  
  如果存在/etc/php.d目录,需要拷贝eaccelerator.ini到该目录下,然后修改缺省值。如果不存在,修改php.ini,在[zend]之前加入以下内容(注:必须放在[zend]之前):
  
  [eaccelerator]
  extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  eaccelerator.shm_size="32"
  eaccelerator.cache_dir="/data/cache/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"
  
  建立缓存目录:
  # mkdir -p /data/cache/eaccelerator
  # chmod 0777 /data/cache/eaccelerator
  
  重启Apache:
  # service httpd restart
  
  
  3、检查ZendOptimizer和eaccelerator是否安装成功
  
  创建一个phpinfo.php文件,内容如下:
  <?php
      phpinfo();
  ?>
  
  将该文件放置到网站目录,在浏览器中访问,如果出现以下内容则安装成功:
  This program makes use of the Zend Scripting Language Engine:
  Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
      with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
      with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies
      with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies
  
  
  
  二、eaccelerator配置信息详解(根据官方英文说明翻译)
  
  extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  
  解释:PHP扩展eaccelerator.so的路径。
  
  --------------------
  
  eaccelerator.shm_size="32"
  
  解释:eaccelerator可使用的共享内存大小(单位为MB)。
  
  在Linux下,单个进程的最大内存使用量受/proc/sys/kernel/shmmax中设置的数字限制(单位为字节),例如CentOS 4.4的shmmax默认值为33554432字节(33554432bytes/1024/1024=32MB)。
  
  临时更改该值:
  # echo 字节数 > /proc/sys/kernel/shmmax
  
  按照以上方法更改,在每次重启系统时,该值会被自动还原。如果想永久更改,可以修改/etc/sysctl.conf文件,设置:
  kernel.shmmax = 字节数
  
  --------------------
  
  eaccelerator.cache_dir="/data/cache/eaccelerator"
  
  解释:缓存路径,可以使用命令mkdir -p /data/cache/eaccelerator创建该目录,然后使用命令chmod 0777 /data/cache/eaccelerator设置该目录权限为0777
  
  --------------------
  
  eaccelerator.enable="1"
  
  解释:打开或者关闭eaccelerator。"1"指打开,"0"指关闭。默认值为"1"。
  
  --------------------
  
  eaccelerator.optimizer="1"
  
  解释:打开或者关闭代码优化,开启可以加快代码的执行速度。"1"指打开,"0"指关闭。默认值为"1"。
  
  --------------------
  
  eaccelerator.check_mtime="1"
  
  解释:当打开此项时,eaccelerator会在每次请求时检查php文件的修改时间,看其是否被修改过,这会耗费一点时间,如果php文件被修改过,eaccelerator会重新编译缓存该php文件。当关闭此项时,如果php文件被修改,则需要手工删除eaccelerator缓存,才能显示被修改的php文件。"1"指打开,"0"指关闭。默认值为"1"。
  
  --------------------
  
  eaccelerator.debug="0"
  
  解释:打开或者关闭调试记录。当打开时,eaccelerator会将对一个缓存文件的每次请求都写进log。打开此项只对调试eaccelerator是否有BUG时有益处。"1"指打开,"0"指关闭。默认值为"0"。
  
  --------------------
  
  eaccelerator.filter=""
  
  解释:决定哪些PHP文件应该被缓存。可以指定一个范围(比如"*.php *.phtml"),这样被指定的文件就会被缓存。如果该范围以!开头,被指定的文件就不会被缓存。默认值为"",表示缓存所有的PHP文件。
  
  --------------------
  
  eaccelerator.shm_max="0"
  
  解释:一个用户使用例如eaccelerator_put之类的函数能够往共享内存中加载的最大数据。默认值为"0",表示不限制。(单位为字节)
  
  --------------------
  
  eaccelerator.shm_ttl="0"
  
  解释:当没有足够的空闲共享内存去尝试缓冲一个新脚本时,将删除至少在shm_ttl秒之前没有被访问过的文件。默认值为"0",表示不尝试从共享内存中删除任何旧的脚本。(单位为秒)
  
  --------------------
  
  eaccelerator.shm_prune_period="0"
  
  解释:当没有足够的空闲共享内存去尝试缓冲一个新脚本时,将删所有旧脚本,前提是这个尝试在超过shm_prune_period秒之前被执行过。默认值为"0",表示不尝试从共享内存中删除任何旧的脚本。(单位为秒)
  
  --------------------
  
  eaccelerator.shm_only="0"
  
  解释:打开或者关闭在磁盘上缓存编译过的脚本。这个参数对会话数据和内容缓存没有效果。默认值为"0",表示使用磁盘和共享内存来缓存。
  
  --------------------
  
  eaccelerator.compress="1"
  
  解释:打开或者关闭缓存内容压缩。"1"指打开,"0"指关闭。默认值为"1"。
  
  --------------------
  
  eaccelerator.compress_level="9"
  
  解释:内存压缩的级别。默认值为"9",表示最大压缩。
  
  
  参考资料:
  1、Installing from source (http://www.eaccelerator.net/wiki/InstallFromSource)
  2、eAccelerator settings (http://www.eaccelerator.net/wiki/Settings)

Tags: ,



技术大类 » PHP/JS/Shell | 评论(36) | 引用(0) | 阅读(62868)
jackbillow
2007-9-2 10:42
如果使用/dev/shm做cache应该更能达到加上php的效果。
smile
Arbow
2008-12-10 10:52
你好,如果使用php扩展方式extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"应该改为extension=eaccelerator.sozend扩展才是zend_extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"因为我使用文章的方式,无法加载,只有改成 extension=eaccelerator.so 才可以。望赐教
wxy1681
2009-1-21 13:44
学习了!grinzan
yfy Email Homepage
2010-3-3 07:16
http://www.838dz.com
dresses Email Homepage
2011-7-26 10:21
Here are a variety of the empire <a href="http://www.romancearound.com/">dresses</a>, I want to introduce yourself. The first shoulder chiffon <a href="http://www.romancearound.com/bridesmaid-dresses-c-197.html">bridesmaid dresses</a> empire style wedding will <a href="http://www.romancearound.com/wedding-dresses-trumpet-wedding-dresses-c-180_253.html">trumpet wedding dresses</a>.This Tia cowries, dressed in her wedding day.Chiffon of the empire the best clothes, because they are the size of the drum as complete motion from the wind the site makes it easy to create a plan impression.One romantic flowers floating above shoulder function and help catch the eyes of the cut of the chest and neck problems, so that more comprehensive coverage of physical illusion bust.Clothing do not like big long torso, short legs, or pear-shaped<a href="http://www.romancearound.com/bridesmaid-dresses-ankle-length-bridesmaid-dresses-c-197_198.html">ankle length bridesmaid dresses</a> figure.special is also suitable for pregnant brides since the mobility as a dress can accommodate more Many of the abdomen.
mayapop Homepage
2011-11-11 15:59
博主有个问题请教一下:
我的小说网 www.xinhuashuwu.com 在参考了您的这篇博文后安装了eaccelerator.速度提升非常明显.
但对设置上有2个疑问.
1. eaccelerator.shm_size="32" 这个参数的最大值,在IIS+php下是不是受php.ini里面的memory_limit 数值限制?
    我的服务器上的memory_limit 设置的是128, 当我把eaccelerator.shm_size设置到256的时候,每次应用池回收后就会出现php错误. 如果把eaccelerator.shm_size设置到128则一切正常.
2. 当 eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="0" 使用默认0的时候,是不是缓存满了之后就无法再继续缓存新的内容?
    一定要这样设置才行吗?
   eaccelerator.shm_ttl="3600"
  eaccelerator.shm_prune_period="3600"
a961fkab82 Email Homepage
2011-11-11 18:48
刀杀人呢?这措施固然听起来很不错,但不必定就能胜利,此事你应当明白啊。”
    血界尊主淡淡的道:“这一点我天然清楚,但其中的一些厉害关联你却并不知道。当初进入世间之时,咱们魔域四界便有商定,彼此先抛却恩怨一致对外。今天我若现身毁灭了他,到时候让魔天尊主与黑暗尊主晓得,他们势必不会罢休,如此我将陷入窘境。
    黑煞虎王恍然道:“本来如斯,怪不得始终不据说你们之间产生过什么抵触。对了,我一直有一事不
On the one hand
banfeng7821 Email Homepage
2011-11-12 03:04
Kelly Rowland: Elle quitte X-Factor après une discussion
Après nous avoir dévoilé son tout nouveau mow Down because however il y a quelques jours (voir notre treatise), Kelly Rowland fait une nouvelle fois parler d'elle. La star,sweat abercrombie, jury de l'émission X-Factor en Angleterre, aurait perdu son sang froid pendant la diffusion du programme. La chanteuse a en effet eu une altercation avec Tulisa Contostavlos,abercrombie new york, nouvelle recrue du programme.
Kelly Rowland a du caractère, et lorsqu'il s'agit de le démontrer, la jeune femme sait y faire ! Alors que la chanteuse ne manque pas de projets, la star fait partie du jury de l'émission X-Factor en Angleterre gush le and grand bonheur de ses fans.
Mais même si les membres du jury doivent travailler ensemble et juger les representations, ils ne peuvent pas être d'accord sur tout. Et ?a,sweat femme abercrombie & fitch, Kelly Rowland en a eu récemment la preuve? avec la prestation de Misha B, la preference de cette septième saison.
A la fin de son passageway sur la scène de X-Factor, Louis Walsh, l'un des membres du jury, a félicité la jeune femme tout en la mettant en garde. "Tu for énormément confiance en toi, peut-être un peu trop". C'est dit !
Alors que Kelly Rowland semble encaisser les critiques dirigées envers sa protégée, Tulisa Contostavlos, nouveau membre du jury, en rajoute une couche ! "Tu  es clairement l'une des stars de l'émission mais tu es à fond dans la  compétition et j'ai vu une nouvelle facette de toi en coulisses. Je  pense que tu ne réalises pas ce que tu fais mais d'une certaine fa?ashore,  ton c?té s?r de toi peut para?tre assez méchant à d'autres candidats. Et  plusieurs candidats m'ont dit cette semaine qu'il y avait eu des  commentaires méchants à leur encontre", a-t-elle précisé. En effet, la jeune femme est en ce moment accusée de tyranniser les autres candidats du agenda.?
Kelly Rowland, director de Misha, vient alors à sa rescousse, reprochant à Louis Walsh le manque de confiance de ses candidats à lui. Louis Walsh va alors (...)  Lire la apartment sur news-de-stars.com
La Source des Femmes :les actrices du movie transportent le théatre du Chatelet dans un autre monde
Juliette, Secret Story 5: "Le libertinage c'est quelque chose d'intime"
Beyoncé : Elle aurait voulu acheter le bébé de son assistante
Marc Olivier Fogiel: Une collaboration avec le Huffington Post?
kelly rowland
louis vuitton uk Email Homepage
2011-11-22 17:30
This louis vuitton uk for sale belongs to the sounding just what are termed as Louis Vuitton vintage best sellers, many other products and services for the reason that range appearing companies.You will easily notice the unfold zippers of this coach outlet store online. That is the decoration. There are some inside pockets for you as well. They are easy to match your clothes and to carry.Let us inspire your inner beauty with fine christian louboutin sale. Purse the elegance in bridal wedding. Enjoy the fashion.
老谢 Email Homepage
2012-1-18 22:09
学习了,配置成功,感谢张晏老师
coach factory outlet Email Homepage
2012-5-17 10:18
Today, following half a century, mentor leather-bases coach factory outlet continues to be the delicate craft of leather-based master is accountable for,Would you like to meet more friends, or go with the times? If yes, coach factory online is opening welcome doors to you.in the market you definitely can find various colorways that are designed in as well as the high quality that applied in. For most of you would like to come. So just come to our coach factory outlet online store to choose one.
louis vuitton sale Email Homepage
2012-5-17 10:18
Louis Vuitton belt at louis vuitton sale is one kind of fashion accessory with high cost performance among the Louis Vuitton accessories.Offering quality LV products with favorable prices, louis vuitton outlet store is at your service. Hurry up, or you can not seize the chance.in fact, louis vuitton is one of the most famous fashion design master.he opened the fist suitcase shop called after his name.
coach outlet online Email Homepage
2012-5-17 10:19
I heard of coach outlet online through the advertisement when I was shopping. And now I often brow the webpage and buy Coach bags online.It is a symbol regarding position not to mention nature.Here I would like to launch a excellent bags pertaining to business men.Which may be coach outlet store.coach outlet has always been simple,durable style features to win consumers.The products are more flexible,with easy bleaching,wear characteristics,and simply use a damp cloth.
coach outlet, Email Homepage
2012-5-17 10:19
Remember the coach outlet provide coach bags which won't be deteriorated into its overall styles by any means. It will maintain its looks, colors, and uniqueness for long time.coach outlet store online has been voted by Hour Detroit magazine readers as the Best of Detroit in their 12th annual readers'poll.Lots of women like which usually amount normally include a coach outlet online ,it provides coziness to many girls that don't even think it is a great bushel of great interest directly to them.
xujie777 Email
2012-5-18 15:03
We aim to make all our customers satisfy with our products. You will find a variety of Men's fashion louis vuitton uk, fashion Women's cheap Louis Vuitton bags in our store at affordable price.Thinking of interesting ways to cost a milestone birthday? louis vuitton online shop had one of the most distinctive distinctive celebrations.bakery along with living room operated by means of about three moment louis vuitton online Most effective Pastry Chef’s of the year Rammy Nominee Chef’s.
xujie777 Email
2012-5-18 15:03
The choices are likely to be basically countless seeing that louis vuitton outlet occurs with the help of completely new and also incredible concepts once in a while.Louis vuitton Wholesale Monogram Canvas HandbagsLouis Vuitton Collection Beach Handbags louis vuitton bags outlet Damier Canvas HandbagsLouis vuitton Mahina HandbagsLouis Vuitton Monogram Mini Lin HandbagsLouis Vuitton Monogram Multicolore HandbagsLouis vuitton Monogram Vernis HandbagsLouis Vuitton Wholesale Epi Leather HandbagsLouis Vuitton For Men HandbagsLouis Vuitton Damier Canvas WalletsLouis Vuitton Epi Leather WalletsLouis Vuitton Monogram Canvas WalletsLouis Vuitton Monogram Vernis WalleLouis Vuitton ShoesLouis Vuitton Men wallets.As the Authentic Louis Vuitton are so high-priced, so came the louis vuitton handbags outlet.
xujie777 Email
2012-5-18 15:03
coach outlet has become a popular shopping experience for consumers around the world, and a desirable distribution channel for manufacturer's and retailers.Getting your hands on coach outlet store online can be a hefty investment of hundreds of dollars.But do not despair,the Coach Outlet store could be the answer to your prayers.coach outlet online is your smart choice when you want to get the discount Coach accessory. You can find the exact Coach Bags and other accessory you want at a low price that's right for you. My dear friends, let the coach outlet online pave your way into the world of high fashion with their ultimate fashion factory.
xujie222
2012-5-21 10:47
Our online store offers you discounted Designer louis vuitton replica wallet at present. You could find them in desirable quality and price. If you don't mind high class louis vuitton uk, have a good time here.louis vuitton Store Online Handbags can also bring great accuracy as well as practical applicability and fashionable.Have you ever dreamed of being as charming as Madonna? Have you ever thought of becoming an envy of all your friends? If so, come to louis vuitton outlet.<br/>
分页: 1/2 第一页 1 2 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]