我在使用远程调试时xdebug没有在断点处停止时遇到问题(通过命令行运行脚本时一切正常).它将在程序的第一行中断,然后退出,而不是捕获任何断点.
它曾经工作正常,直到我切换到使用MacPorts for Apache和PHP.我已经尝试过多次重新编译(有几个版本),但没有骰子.
我正在使用PHP 5.3.1和Xdebug 2.1.0-beta3
我还尝试过至少3种不同的调试程序(MacGDBp,Netbeans和JetBrains Web IDE).
我的php.ini设置如下:
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=localhost
xdebug.idekey=webide
Run Code Online (Sandbox Code Playgroud)
当我记录调试器输出时,设置断点看起来像这样/;
<- breakpoint_set -i 895 -t line -f file:///Users/WM_imac/Sites/wm/debug_test.php -n 13 -s enabled
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="895" state="enabled" id="890660002"></response>
运行时,调试器将获取应用程序第一行的上下文,然后发送分离和停止消息.
但是,启动调试器时会输出此行.
<- feature_get -i 885 -n breakpoint_types
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="885" feature_name="breakpoint_types" supported="1"><![CDATA[line conditional call return exception]]></response>
"行条件调用返回异常"是否意味着什么?
我知道关于这个问题有无数的问题,但无论我尝试过什么,我都没有运气.我遇到的问题是关于使用NetBeans和XDebug时的断点(在Windows 8.1上,如果这会影响任何事情).
问题是没有断点正常工作.默认情况下,在使用NetBeans进行调试时,它会在第一行停止,并且会成功执行此操作.因此,NetBeans以某种方式连接到XDebug.但是,任何其他文件中的任何其他断点都不起作用.
我已经在php.ini文件中尝试了各种不同的设置但到目前为止没有运气.我也试过打开XDebug日志文件,这样我也许可以分析一下发生了什么,但这也行不通.最后我尝试设置断点xdebug_break(),但也没用.
php.ini中的XDebug设置
;[XDebug]
; Only Zend OR (!) XDebug
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
Run Code Online (Sandbox Code Playgroud)
NetBeans上的项目运行配置


我已经看过以下内容:
另请注意,这是在3天前工作,但今天没有断点正常工作.
附加信息
我在cmd中运行以下命令,php -v并显示以下警告:
Warning: Module 'xdebug' already loaded in Unknown on line 0
这是否意味着xdebug试图加载两次?如果是这样,我不确定如何解决这个问题
我的netbeans使用xdebug不能使用断点,我的配置看起来是正确的,所以我第一次配置我第一次停止调试从那时起从未工作,有人有这个问题吗?我的netbeans的版本是6.8,php的版本是2.5.2.
我的php.ini:
zend_extension_ts = d:\wamp\bin\php\php5.2.5\ext\php_xdebug-2.0.2-5.2.5.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1
Run Code Online (Sandbox Code Playgroud) 我安装了Xdebug 2.1,并运行PHP 5.2.13.它可以成功连接到多个DBGP客户端(即xdebug.remote_log显示来回通信,客户端本身也显示传入连接),但它不会在断点处停止.我尝试过NetBeans,MacGDBp以及debugclient与Xdebug捆绑在一起的命令行.
典型的交易所看起来像:
Log opened at 2010-07-20 09:33:17
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///mnt/hgfs/htdocs/mycompany/index.php" language="PHP" protocol_version="1.0" appid="14371" idekey="macgdbp"><engine version="2.1.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2010 by Derick Rethans]]></copyright></init>
<- status -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="macgdbp" status="starting" reason="ok"></response>
<- step_into -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="macgdbp" status="stopping" reason="ok"></response>
<- status -i macgdbp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="macgdbp" status="stopping" reason="ok"></response>
Log closed at 2010-07-20 09:33:18
Run Code Online (Sandbox Code Playgroud)
NetBeans尝试设置断点,Xdebug承认这些断点:
<- breakpoint_set -i 7 …Run Code Online (Sandbox Code Playgroud) 我有一个netbeans项目,其目录树如下:
<source folder>
|
|---> gui <web root folder>
| |
| L---> datos.php
|
L---> index.php
Run Code Online (Sandbox Code Playgroud)
datos.php将工作目录更改为..(源文件夹)并包含index.php,如下所示:
chdir('..');
require 'index.php';
Run Code Online (Sandbox Code Playgroud)
如果我在datos.php中放置一个断点,调试器会正确地打破它,但是当在index.php中放入一个断点时,它会忽略它.
奇怪的是6个月前我遇到了同样的问题,我能够解决它.现在我不知道它为什么停止工作以及我当时做了什么来修复它.
更多信息:
xdebug日志显示以下用于断点设置的命令:
breakpoint_set -i 315 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
breakpoint_set -i 316 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/gui/datos.php -n 39
Run Code Online (Sandbox Code Playgroud)
在这两种情况下,xdebug以state ="enabled"响应
如果我手动调试,我可以使用以下命令设置断点,它的工作原理如下:
breakpoint_set -i 315 -t line -s enabled -f file:///../index.php -n 51
Run Code Online (Sandbox Code Playgroud)
但我不知道怎样才能使netbeans发出带有相同file:///../index.php参数的breakpoint_set命令而不是file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php或任何其他方式我可以使这项工作.
在此先感谢您的帮助!