所以eclipse和xdebug走进了一个酒吧,然后我的apache服务器死了。
我正在使用Windows xp x86,wamp,apache2,php 5.3 x86,eclipse php和xdebug,在localhost上运行,作为虚拟主机和https虚拟主机
eclipse 版本信息
Eclipse for PHP Developers Version: Helios Release Build id: 20100617-1415
我成功地设法,不知何故,设置了eclipse和xdebug,一切都很好。
然后,我必须为我的项目创建一个svn分支,并使用2个新的虚拟主机重新配置apache,并更新我的Windows主机文件。
现在,当我在eclipse中启动调试模式时,一切都死了。
具体来说,如果我没有设置断点,应用运行正常,除了我首先尝试调试的问题。
如果我设置了断点,则应用会在断点处停止,并且 eclipse 似乎握住了球。但是现在,当我按继续,或跨过,或步入,或打喷嚏时,eclipse告诉我执行已恢复,但应用程序继续挂起,我必须重新启动apache。
我怀疑 eclipse 和 xdebug 之间的通信存在一些中断,因为在我看来,eclipse 正在发送我的 continue 或 step over 命令,但 xdebug 没有收到它。
但即使如此,我也不知道该怎么办。我应该去哪里找?
更新:
我已经成功地使用记事本++,它的xdebug插件进行调试,并且像穴居人一样,在url中键入&XDEBUG_SESSION_START=session_name。但是,尽管我喜欢npp,但它的调试插件还是很有缺陷......
所以我在stackoverflow上注意到一个名为“phpstorm”的广告,它声称是一个轻量级但功能齐全的php ide,具有原生xdebug支持。该演示需要重新启动才能使其正常工作,这感觉有点像在摇摇晃晃的草稿表上工作,但它设法很好地调试了我的小型测试应用程序和真实应用程序,这比我目前对eclipse可以说的要多,尽管这可能是我的错。
我可能应该早点发布这个:/这是我的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
这是我重现问题时的xdebug日志文件
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