本文 7572 pv

0

安装 dbg debugger 来调试你的 PHP 程序(windows)

© kekehu / 技术资源 / 2006.03.18 / 18:19 / 7572PV

/*
转贴请保留
题目:安装dbg debugger来调试你的PHP程序
作者:z33
出自:http://www.itroot.org
*/
本教程是继续上一篇< 搭建Windows下基于Eclipse的PHP开发环境>,所以之前需要安装eclipse,eclipse是IBM公司主持开发的很棒的开发平台,现在版本已经是3.0了。
文章地址:
http://www.openphp.cn/index.php?module=article&id=27

·先下载php_dbg.dll,下载地址如下:
http://dd.cron.ru/dbg/download.php?h=211.23-win32

·解压缩,然后找到和你所安装的PHP版本相同的php_dbg.dll-x.x.x,
把名字改成php_dbg.dll然后复制php_dbg.dll到你的PHP安装目录下的extensions目录下。

·编辑php.ini,查找以下几项,并按下面的设置做更改:
; this is to see output while debugging
implicit_flush = On

; 这里检查一下,设置自己的php安装目录下的extensions目录路径
extension_dir = "c:phpextensions

; 填加php_dbg.dll的配置项
extension=php_dbg.dll

; 填加DEBUG配置项
[debugger]
debugger.enabled = true
debugger.profiler_enabled = true
debugger.JIT_host = clienthost
debugger.JIT_port = 7869

·重启Apache。

·现在就可以打开eclipse调试一个PHP脚本了,先在菜单栏里选"RUN"下的"Add/Remove Breakpoint"项设置上断点。

·点<图1>中的debug按钮右侧小箭头,选Debug as -> PHP Application,
会出现一个提示,询问你是否进入Debug视图进行调试,选择“是”,进行Debug视图。
点击在新窗口中浏览此图片
·进来之后一目了然,可以单步调试,右侧是所有的变量监视,爽吧。如<图2>
点击在新窗口中浏览此图片

本文有 0 篇评论

发表你的见解

打开HTML 打开UBB 打开表情 隐藏 记住我
emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemot