我连续几天尝试在 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 个字节:
但没有数据。这是正常的吗?请给我提示在哪里进一步挖掘?
谢谢大家。