无法使 Xdebug 与 Eclipse PDT 配合使用


Can't make Xdebug work with Eclipse PDT

我已经安装了Eclipse PDTXdebug XAMPP。虽然网络上有各种解决方案,但我找不到解决我的问题的方法。

这是我的 XAMPP 中的 phpinfo(),它显示安装了 xdebug

xdebug
xdebug support  enabled
Version 2.2.6
IDE Key XDEBUG_ECLIPSE
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.cli_color    0   0
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.coverage_enable  On  On
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.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  '   '
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%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:8756  localhost:8756
xdebug.remote_log   no value    no value
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_enable_trigger Off Off
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir '   '
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 PDT 在 57% 处暂停,eclipse 显示"正在启动:等待 Xdebug 会话"以下是生成的网址

127.0.0.1:8756/Mywebsite/index.html?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14170721856664

我关注了各种网站,但所有的努力都是徒劳的。

这是 Xdebug 的 php.ini 部分:

zend_extension = D:'xampp'php'ext'php_xdebug-2.2.6-5.5-vc11.dll
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:'xampp'tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = "localhost:8756"
xdebug.trace_output_dir = "D:'xampp'tmp"
;xdebug.remote_connect_back=1
xdebug.remote_port=9000

注意:由于默认的apache端口8080被占用,我已将我的apache配置为8756

在 Eclipse PDT 中等待 XDebug 会话 57% 也无能为力!

提前感谢!!

您的配置无效。将当前xdebug.remote_host替换为仅主机。此处不允许端口。

顺便说一句:默认情况下您启用了分析。这可能会减慢每个请求的速度;)

经过几个小时的低谷帖子,我终于有了我的OMG它的工作经验,在php.ini中使用以下行:

zend_extension = "d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
zend_extension_ts="d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
zend_debugger.allow_hosts=127.0.0.1/32,192.168.2.3/32
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_connect_back=1
xdebug.remote_port=9100

注意 d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll 必须替换为您的路径/dll。我已经在 php.ini 中更改了我的端口。确保在 Eclipse 中使用相同的端口(调试配置 --> 调试器 --> 配置 --> 调试端口 --> 9100)

问候

话筒