【发布时间】:2011-05-29 09:32:37
【问题描述】:
我正在使用 windows xp x86、wamp、apache2、php 5.3 x86、eclipse php 和 xdebug,在 localhost 上作为虚拟主机和 https 虚拟主机运行
eclipse 版本信息
面向 PHP 开发人员的 Eclipse
版本:Helios 发布
内部版本号:20100617-1415
不知何故,我成功地设置了 eclipse 和 xdebug,一切都很好。
然后我必须为我的项目创建一个 svn 分支,并使用 2 个新的虚拟主机重新配置 apache,并更新我的 windows 主机文件。
现在,当我在 eclipse 中启动调试模式时,一切都死了。
具体来说, 如果我没有设置断点,应用程序运行良好,请先解决我尝试调试的问题。
如果我设置断点,应用程序会在断点处停止,并且 eclipse 似乎正在控制球。但是现在,当我按下继续,或跳过,或进入,或打喷嚏时,eclipse 告诉我执行已恢复,但应用程序继续挂起,我必须重新启动 apache。
我怀疑 eclipse 和 xdebug 之间的通信出现了一些中断,因为在我看来 eclipse 正在发送我的 continue 或 step over 命令,但 xdebug 没有收到它。
但即使是这样,我也不知道该怎么办。我应该去哪里看?
更新:
我已经成功地能够使用notepad++、它的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
【问题讨论】:
-
我真的帮不上忙,但我遇到了类似的问题,xdebug 随机崩溃 Eclipse/恢复。它仍然不时发生,但我不知道为什么。我会很感兴趣地看到答案。哦,+1 令人耳目一新的幽默:D
-
+1 为标题,如果有人编辑它,让我知道,我会为你恢复它(或恢复它
;))~~~至于实际问题,idk,但听起来你知道中断在哪里(在 eclipse 和 xdebug 之间)......我不使用 eclipse/apache,所以我帮不了你,但祝你好运。 -
1.我不喜欢 PHPStorm。我发现它笨重且无法使用。 2. 您使用的是 32 位还是 64 位 Eclipse,分别是哪个版本? 32 位或 64 位 PHP,以及哪个版本?
-
我假设您尝试过将 PHP/XDebug 设置重置为默认设置并从头开始配置?如果你这样做,那么至少你可以确定不是你的 XDebug 配置导致了问题。然后尝试重置 Apache 主机设置并仅将您的活动程序添加为虚拟主机,调试您的程序,然后稍后添加其他程序(取决于您在它上面运行了多少其他东西,以及在您这样做时延长停机时间是否可行这)。同样,尝试创建一个与您的程序相关联的新 Eclipse 项目并在调试中运行它以查看它是否是 Eclipse 的设置。
-
xdebug 曾经在 Windows 上遇到 curl PHP 扩展问题。如果您启用了它,请尝试禁用它以查看是否有帮助。
标签: php eclipse apache debugging xdebug