Bry*_* M. 36 php debugging xdebug
我在使用远程调试时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>
"行条件调用返回异常"是否意味着什么?
小智 33
我有这个问题,并花了我很多年才找到答案.
在调试配置中,在服务器区域中,单击"配置",转到"路径映射",单击其中的路径,然后单击"编辑",更改为"文件系统中的路径"并导航到正确的文件.
完成.
小智 20
我有同样的问题,最后我发现我的php.ini缺少这两个重要的设置:
xdebug.remote_autostart = "On"
xdebug.remote_enable = "On"
Run Code Online (Sandbox Code Playgroud)
然后它完美地工作.
XDebug在我的Ubuntu Lucid框中使用NetBeans工作正常,我的php.ini(/etc/php5/apache2/php.ini)中有zend_extension行.
我正在使用netbeans 6.9和PHP 5.2与xdebug 2.0.4-2
我在这里粘贴相关的行,希望它有所帮助:
zend_extension=/usr/lib/php5/20060613/xdebug.so
[debug]
; Remote settings
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=1
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=
; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32
; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32
Run Code Online (Sandbox Code Playgroud)
来自http://xdebug.org/docs/install ,"你应该忽略任何提示将"extension = xdebug.so"添加到php.ini - 这会导致问题."
所以,这为我修好了:
在配置文件中,您加载xdebug扩展(对我来说,对于CLI的CLI版本,即/etc/php5/cli/conf.d/xdebug.ini) - 不要指定
延长= xdebug.so
相反,使用
的zend_extension = /路径/到/ Xdebug的/模块/ xdebug.so
(对我来说,这就像/usr/lib/php5/(...)/xdebug.so)
我遇到了同样的问题,我的解决方案是将本地代码放在与远程代码相同的路径上.
在Web服务器上,代码位于路径上: /var/www/dev01/app_name
本地代码位于我的主目录中: /home/me/projects/app_name
这种配置导致我的IDE(Eclipse和Komodo)直接飞过断点.
更改本地路径/home/me/projects/app_name
以/var/www/dev01/app_name
解决问题.使用sshfs本地挂载远程文件系统使其更加容易.
归档时间: |
|
查看次数: |
36452 次 |
最近记录: |