Mat*_*att 46 php eclipse apache debugging xdebug
我使用windows xp x86,wamp,apache2,php 5.3 x86,eclipse php和xdebug,在localhost上运行同时作为虚拟主机和https虚拟主机
eclipse版本信息
Eclipse for PHP Developers版本:Helios发布版本号:20100617-1415
我不知何故成功地设置了eclipse和xdebug,一切都很顺利.
然后我必须创建我的项目的svn分支,并使用2个新的虚拟主机重新配置apache,并更新我的Windows主机文件.
现在,当我在eclipse中启动调试模式时,一切都会消失.
具体来说,如果我没有设置断点,应用程序运行正常,除了我试图首先调试的问题.
如果我设置断点,应用程序会在断点处停止,而eclipse似乎正在控制球.但是现在,当我按下继续,或者跳过,或者进入或打喷嚏时,eclipse告诉我执行已经恢复,但是应用程序继续挂起,我必须重新启动apache.
我怀疑eclipse和xdebug之间的通信有一些中断,因为它看起来像eclipse正在发送我的继续或步骤命令,但xdebug没有收到它.
但即便如此,我也不知道如何应对.我应该在哪里看?
更新:
我已经成功地使用notepad ++,其xdebug插件进行调试,并且像一个穴居人一样,在URL中输入&XDEBUG_SESSION_START = session_name.然而,尽管我喜欢npp,但它的调试插件却非常错误......
所以我注意到了一个名为"phpstorm"的stackoverflow上的广告,它声称是一个轻量级但功能齐全的php ide,具有本机xdebug支持.该演示需要重新启动以使其工作,并且感觉有点像在摇摆的草稿表上工作,但它设法调试我的小测试应用程序和真正的应用程序非常好,这比我可以说的更多的日食那一刻,即使它可能是我的错.
我可能应该早些发布这个:/这是我的phpinfo()xdebug部分
xdebug
xdebug support enabled
Version 2.1.0
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey no value no value
xdebug.manual_url http://www.php.net http://www.php.net
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir C:\xampp\tmp C:\xampp\tmp
xdebug.profiler_output_name xdebug_profile.%p xdebug_profile.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log c:\xampp\apache\logs\xdebug.log c:\xampp\apache\logs\xdebug.log
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir C:\xampp\tmp C:\xampp\tmp
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_displ
ay_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
Run Code Online (Sandbox Code Playgroud)
这是我重现问题时的xdebug日志文件
Run Code Online (Sandbox Code Playgroud)Log opened at 2011-01-03 08:56:22 -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" language="PHP" protocol_version="1.0" appid="4404" idekey="ECLIPSE_DBGP"><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> <- feature_set -i 33 -n show_hidden -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="33" feature="show_hidden" success="1"></response> <- feature_set -i 34 -n max_depth -v 3 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="34" feature="max_depth" success="1"></response> <- feature_set -i 35 -n max_children -v 31 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="35" feature="max_children" success="1"></response> <- feature_get -i 36 -n encoding -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="36" feature_name="encoding" supported="1"><![CDATA[iso-8859-1]]></response> <- feature_get -i 37 -n supports_async -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="37" feature_name="supports_async" supported="1"><![CDATA[0]]></response> <- stdout -i 38 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="38" success="1"></response> <- stderr -i 39 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stderr" transaction_id="39" success="0"></response> <- breakpoint_set -i 40 -t line -f file:///C:%5Cxampp%5Chtdocs%5Clab%5Czf-tutorial%5Cpublic%5Cindex.php -n 21 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="40" id="44040001"></response> <- run -i 41 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="41" status="break" reason="ok"><xdebug:message filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></xdebug:message></response> <- stack_get -i 42 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="42"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></stack></response> <- stack_get -i 43 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="43"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></stack></response> <- eval -i 44 -- JHRoaXMtPmZpZWxkc1snYm9vbF9jb21wbGV0ZSdd -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="44"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 45 -- JHRoaXMtPnN0YWdlLT5nZXQoJ2Jvb2xfY29tcGxldGUnKQ== -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="45"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 46 -- JHRoaXMtPmZpZWxkc1snYm9vbF9jb21wbGV0ZSdd -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="46"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 47 -- JHRoaXMtPnN0YWdlLT5nZXQoJ2Jvb2xfY29tcGxldGUnKQ== -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="47"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> === breakpoint reached, execution pauses. In eclipse I click "step over" <- step_over -i 48 === end of log
呜呜呜呜
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312951#c8
创建新的工作区使我能够成功调试。
现在,我对导致此问题的最佳猜测是在同一工作区中有两个项目,并且同一 IP 具有不同的虚拟主机。
所以我不会再这样做了。