在Eclipse PDT中等待XDebug Session 57%

时间:2012-03-02 13:42:53

标签: xdebug eclipse-pdt

当我写这条消息时浏览提示似乎这是一个棘手的问题与所有类型的补丁,但没有明确的答案......无论如何,我试试我的机会,在这里。 我在Ubuntu 10.04上使用Eclipse Helios PDT,使用XDebug和php.ini中的相应部分如下:

xdebug support  enabled
Version 2.0.5

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.125.2.6 $
GDB - GNU Debugger protocol $Revision: 1.87 $
PHP3 - PHP 3 Debugger protocol  $Revision: 1.22 $

Directive   Local Value Master Value
xdebug.auto_trace   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.idekey   no value    no value
xdebug.manual_url   http://www.php.net  http://www.php.net
xdebug.max_nesting_level    100 100
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  /tmp    /tmp
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_enable    Off Off
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
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 /tmp    /tmp
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

到目前为止,我一直在使用Eclipse进行PHP开发而没有任何问题,但从未使用过调试。当我在调试模式下启动项目时,我在后台浏览器中正确启动了应用程序,我的Debug / PHPDebug透视图是空的,而在Eclipse控制台中,我在此帖子的标题中有消息。 谢谢你的帮助

6 个答案:

答案 0 :(得分:20)

如果Eclipse停止在57%,则无法启动远程调试过程。这种情况可能就是......

  • 您未在文件/PHP/php.ini中启用远程调试:

    xdebug.remote_enable=on
    
  • 远程主机IP地址(启动调试会话的客户端(您的IDE))不正确:

    xdebug.remote_host=IP_ADDRESS
    
  • 您可以使用以下命令启用“multihost”远程调试,而不是定义远程主机IP地址。

    xdebug.remote_connect_back=1
    

另请查看xdebug文档以了解所有设置:http://xdebug.org/docs/all_settings

答案 1 :(得分:2)

我正努力设置xdebug和eclipse一段时间。

我在32位系统上使用ubuntu 12.04。 要设置最新版本的eclipse(juno)和灯技术堆栈,我强烈推荐this教程。设置虚拟主机也有很好的指南 - 包括脚本。

而不是关注安装xdebug的部分,而是使用@hakre在相关custom installation instructions中引用的xdebug的post

一旦xdebug出现在phpinfo输出中,你可以继续为xdebug设置eclipse,如前面提到的教程所述。

如果仍然无效,请确保

  • 已阅读上述答案
  • xdebug的端口是免费的,与eclipse的调试配置相匹配 - >服务器标签 - >服务器部分 - >配置按钮(默认为9030!)

并尝试

  • 从php.ini文件中的zend_extension属性中删除引号
  • 将所有xdebug设置放在php.ini文件中 - 我没有使用xdebug.ini文件。
  • 在eclipse debug-configuration中重复文件名 - >服务器标签 - >网址部分 - >最后一个输入字段如下所示。

enter image description here

答案 2 :(得分:2)

我发现问题与特定浏览器Firefox有关,可能是由于java更新为7_21。

请在此处查看我的解决方案 Eclipse, XAMPP, xDebug - waiting for XDebug session - stays in 57%

答案 3 :(得分:1)

尝试在以下位置编辑php.ini:wamp \ bin \ apache \ Apache2.4.4 \ bin

xdebug.remote_enable = on
xdebug.remote_host="localhost"
xdebug.remote_connect_back=1

我有一个问题 - 在使用WAMP时编辑php文件夹php.ini似乎还不够。

答案 4 :(得分:1)

我遇到了同样的问题,并试图修复它!我用远程主机,端口监听和Eclipse设置验证了所有内容。我终于发现问题是我需要在我的php.ini中为XDebug指定IDE,如:

xdebug.idekey=ECLIPSE_DBGP

答案 5 :(得分:0)

我发现对我来说,这是xdebug.idekey=ECLIPSE_DBGP中缺少的c:>\php\php.ini

无论如何,这是我当前对xdebug的php.ini配置,请注意,我尚未设置远程地址:

[xdebug]
zend_extension=C:\php\ext\php_xdebug-2.9.6-7.3-vc15-nts-x86_64.dll
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
;xdebug.remote_host=127.0.0.10
xdebug.remote_autostart=1
xdebug.remote_port=9000
xdebug.show_local_vars=1
xdebug.expose_remotely=always
xdebug.default_enable=1
xdebug.idekey=ECLIPSE_DBGP

我的环境: W10 x64,php7.3.18非线程安全,IIS作为Web服务器