文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>为您的PHP加速[afterBURNER*Cache的安装]

为您的PHP加速[afterBURNER*Cache的安装]

时间:2007-02-17  来源:PHP爱好者

afterBURNER * Cache
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
afterBURNER * Cache 用是PHP写的提高Web应用运行速度的一种新工具
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
它的运行原理很简单:PHP程序第一次运行时,会被自动编译,并缓存起来。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
当该PHP程序再次被请求时,则不再重新编译,而是直接从缓存中调用,
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
从而大幅提升WEB站点的性能。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
最新BETA版为version 0.7,可以将一个web应用程序性能提升大约40%,
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
这个数据和著名PHP Code Cache(ZEND)的600%相比显然微不足道。但是
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
afterBURNER * Cache目前仍然只是beta,他们的开发团体仍然在不断的
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
优化它的代码,修正bug,相信过不了,“无钱消受”PHP Code Cache
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
的朋友将会有一个令他们满意的替代产品-----完全免费的afterBURNER * Cache
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
的稳定版本。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
好了,废话讲了这么多,快来试试好不好用吧!
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
打开http://www.php4win.de
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
下载 php4.0.5-dev for win32 [2001-01-30]
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
下载 bware cache 0.7 for php 4.0.5-dev [2001-01-30] only!
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
假设您的php安装在c:php4
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
那么请您现停掉您的web server 然后删除c:php4目录
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
删除%system%目录下面的php4ts.dll文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
将windows或者winnt目录下的php.ini该名为php.old文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
解压缩php,释放文件到c:php4,copy 新的Php4ts.dll文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
到%system%目录下面去,同时copy dlls目录下的文件到
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
%system%目录下面去,如果提示msvcrt.dll文件正在使用
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
中,无法copy的话,请先不要管它。继续下面的步骤。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
如果PHP提供给您的msvcrt.dll文件的版本要比您系统中的
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
新的话,您过一会儿可以到dos下去copy这个文件。否则就
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
不要管它。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
修改php.ini-dist为php.ini,按照php.old,重新配置php.ini文件。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
后copy到winnt或者windows目录下面去。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
好了,启动您的web server,看一看<? print phpinfo() ?>
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
版本是不是php4.0.5-dev
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
下一步解压缩bware_cache,将得到的php_bwcache.dll文件copy
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
到c:php4extensions目录中去作为php的一个外设扩展库
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
然后在php.ini中加载这个扩展库,具体添加这些代码
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
extension_dir = c:/php/extensions
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
......
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; put these code in the file named php.ini
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
[bwcache]
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_enable=1 ;
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_check_stamp=1
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_log_level=1
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_only="*.php *.tpl"
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
;ok,end here
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
解释一下这些东东!
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
前三个选项的值仅是1或者0,表示打开或者关闭这项功能
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_enable=1;
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; 1,打开bware_cache;0,关闭bware_cache
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_check_stamp=1;
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; 强制检查编译后php程序的代码是否已经被改动
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; 代开这项功能会降低速度
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_log_level=1
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; 记录bware_cache的行为在web server的error_log files中
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache_only="*.php *.tpl"
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
; 缓存哪些文件呢?
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
参数格式如下
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
*_string_ 缓存文件名以_string_结尾的文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
_string_* 缓存文件名以_string_开始的文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
!*_string_ 不缓存文件名以_string_结尾的文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
!_string_* 不缓存文件名以_string_开始的文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
如果bware_cache_only="" ,值为空
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
那么bware_cache将会尝试缓存任何一个php文件
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
好了,完成php.ini的配置以后。重新启动web server。
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
CGI模式,不需要重新启动web server
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
再次看看<? print phpinfo() ?>看是否有
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache support enabled
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
cvsid $Header: /usr/local/bware/CVS/wapzilla/src/bware_cache/
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
bware_cache.c,v 1.15 2001/01/26 18:32:08 bob Exp $
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
......
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw

www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
看到了,那么恭喜你,搞定了!
www.chinaitp ower .comV9PR5PI17x2Bvx4DiBm4OUzPw
请检查一下是否有什么步骤遗漏了!祝你好运!
非常全面的一个php技术网站,php爱好者站 http://www.phpfans.net 有相当丰富的文章和源代码.
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载