【问题标题】:Setting up IntelliJ Idea remote debugging with XDebug使用 XDebug 设置 IntelliJ Idea 远程调试
【发布时间】:2013-10-05 21:31:41
【问题描述】:

我连续几天尝试在 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 开始调试会话时,它会打开一个地址为 "http://192.168.56.101/index.php?XDEBUG_SESSION_START=some id" 的浏览器,而调试器则开始等待同一个 ID。

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

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

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

提前谢谢大家。

【问题讨论】:

    标签: php debugging intellij-idea xdebug


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      在 IntelliJ IDEA 中安装 xdebug 1st Windows wamp 上 intelliJ IDEA 上 xdebug 的正确设置是外观 对于 php.ini 文件,在 zend 扩展粘贴后在底部找到 xdebug 跟随然后重新启动 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

      【讨论】:

        猜你喜欢
        • 2012-05-05
        • 2012-07-23
        • 1970-01-01
        • 2011-08-31
        • 2014-12-03
        • 1970-01-01
        • 2016-11-18
        • 1970-01-01
        • 2017-05-13
        相关资源
        最近更新 更多