0

我的电脑上有 2 个 wordpress 安装。一个安装是服务器类型,并在端口 80 上使用 stream_socket_client 函数调用其他安装。当我在客户端设置断点并在 eclipse 中进行调试会话时,这部分代码被执行,但 xdebug 调试器无法在断点处停止。使用 curl 调用相同的请求时,我没有同样的问题。

我使用 Mac OS,但在 Linux 上遇到同样的问题。

我的 xdebug 配置是:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable = on
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9000
xdebug.remote_host="127.0.0.1"
xdebug.remote_log=/var/log/xdebug_remote_log
xdebug.remote_autostart=1
xdebug.profiler_enable_trigger=on
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=cachegrind.out.%s.%t
xdebug.collect_return=on
xdebug.collect_vars=on
xdebug.auto_trace=0
4

1 回答 1

0

我找到了一个解决方案:

首先,它应该在 eclipse 的 xdebug 选项中启用多会话。

第二,它应该在请求头中添加以下行:

Cookie: XDEBUG_SESSION=ECLIPSE_DBGP;
于 2012-10-29T16:00:29.570 回答