php dbgp_NotePad++ 使用 DBGp 调试php

1.使用phpinfo();查看php版本信息

126524743_1_20180307110812675.png

2.配置xdebug

2.1 根据php版本信息,下载对应的xdebug .

126524743_2_2018030711081382.png

2.2将下载的php_xdebug-2.1.2-5.3-vc6.dll文件放到php安装目录下面ext目录中。

2.3在php.ini中添加如下配置:

126524743_3_20180307110813191.gif

[xdebug]

zend_extension = "D:/LAMP/PHP535/ext/php_xdebug-2.1.2-5.3-vc6.dll"

xdebug.remote_enable=1

xdebug.remote_handler=dbgp

xdebug.remote_host=127.0.0.1

xdebug.remote_port=9000

xdebug.remote_mode=req

xdebug.idekey=xdebug

xdebug.remote_log="d:\temp\xdebug\xdebug.log"

xdebug.show_exception_trace=0

xdebug.show_local_vars=9

xdebug.show_mem_delta=0

xdebug.trace_format=0

xdebug.profiler_enable = 1

xdebug.profiler_output_dir ="d:\temp\xdebug"

126524743_3_20180307110813191.gif

2.4 重启apache服务器,通过phpinfo();查看是否有xdebug相关输出信息。

3.配置DBGp插件

3.1 下载最新版的DBGp插件 https://sourceforge.net/projects/npp-plugins/files/DBGP%20Plugin/

3.2 将解压得到的dll文件拷贝到 NotePad++安装目录下的plugins目录里,然后重新打开NotePad++。

3.3 在“插件”菜单栏下将会出现 DBGp子菜单,选择config ,进入配置。

126524743_4_20180307110813332.png

IDE KEY 和 php.ini中的xdebug.idekey配置一样。

3.4 打开 插件->DBGp->Debugger

126524743_5_20180307110813472.png

点击红点,会在光标所在行添加断点。

3.5 在要调试的页面URL后添加 ?XDEBUG_SESSION_START=session_name

例如: http://localhost/test.php?XDEBUG_SESSION_START=abcd

参考:http://thecancerus.com/debugging-php-using-xdebug-and-notepad-part-i/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值