2

我连续几天尝试在 IntelliJ Idea 和 Xdebug 中设置远程调试,但没有成功。

我有一个 Windows 7 主机和带有 Windows XP 的 VM VirtualBox 作为 Web 服务器。它安装了带有 Apache、PHP 和 Xdebug 的 WampServer。

Xdebug 配置正确:

Summary
Xdebug installed: 2.2.3
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.4.16
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: C:\wamp\bin\apache\apache2.4.4\bin\php.ini
Extensions directory: c:\wamp\bin\php\php5.4.16\ext

Web 服务器和 PHP 工作正常,没有任何问题。

以下是我在 Intellij 中设置远程调试的步骤:

文件->设置->PHP->服务器 在此处输入图像描述

运行/调试配置: 在此处输入图像描述

php.ini xdebug 部分:

[Xdebug]
zend_extension = "c:\wamp\bin\php\php5.4.16\zend_ext\php_xdebug-2.2.3-5.4-vc9.dll"
;xdebug.profiler_enable=1
xdebug.profiler_output_dir="c:\wamp\tmp"
xdebug.remote_autostart=1
xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=192.168.56.1
;xdebug.idekey="intellij"

评论的那些行是我已经尝试打开/关闭但没有成功的行。

当我从 IntelliJ 开始调试会话时,它会打开一个带有 address 的浏览器"http://192.168.56.101/index.php?XDEBUG_SESSION_START=some id",而调试器则开始等待同一个 ID。

我已经尝试过: - 禁用/调整防火墙 - 更改默认侦听端口 - 设置“远程调试配置”模板,从浏览器和许多其他设备手动启动调试器。

我使用嗅探器确保我的主机在端口 9000 上接收到一些东西:它确实从服务器接收到 62 个字节:

在此处输入图像描述

在此处输入图像描述

但没有数据。这是正常的吗?请给我提示在哪里进一步挖掘?

谢谢大家。

4

2 回答 2

1

通过使用 XAMPP 而不是 WampServer 重新安装 Web 服务器终于解决了这个问题。当然它并没有给我确切的答案是什么导致了之前的配置失败,但无论如何,现在它可以工作了,我对此很满意。

于 2013-10-06T22:35:18.397 回答
0

在 intelliJ IDEA 中安装 xdebug 在 Windows wamp 上的 intelliJ IDEA 上安装 xdebug 的第一个正确设置是查找 php.ini 文件在底部找到 xdebug,在 zend 扩展粘贴之后然后重新启动 wamp 服务器它对我来说非常好用

[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_autostart=0

于 2014-09-29T21:40:29.630 回答