PhpStorm - 按需 xDebug 未附加

PhpStorm - xDebug on demand not attaching

我试用了您的新功能 "xedbug on demand"。我坚持使用这些指南 (https://www.jetbrains.com/help/phpstorm/2016.3/configuring-xdebug.html and https://blog.jetbrains.com/phpstorm/2016/06/xdebug-on-demand-for-cli-php-scripts-in-phpstorm-2016-2-eap/)。

我在 php 服务器菜单中看到,当我将路径添加到 PhpStorm 识别它的 xdebug 时(标签从 "not installed" 切换到 "XDebugger 2.4.1")。

所以一切似乎都很好,但是当我通过错误图标使用调试器时,它从来没有 attaches/stops 作为断点。

我激活了 xdebug-Logfile,但它仍然是空的。

此外,我在 php.ini.

中评论了所有与 xdebug 相关的内容

xdebug 端口仍在 9000(默认)。

有什么想法可以解决吗?

更新:我正在通过 phpStorm 的 "PHP Web Application" 和调试图标使用调试器。我正在调试通过 apache vHost 执行的 php 文件。

PS:检查了 IntelliJ 论坛和 Stack 帖子,但没有找到任何有用的信息...

“按需 Xdebug”选项仅适用于 CLI 调试(Run/Debug“PHP 脚本”类型的配置;也适用于其他 CLI-mode 配置,例如“PHPUnit”)是本地的还是远程的。

引自上述introduction blog post

To use the great new feature, first, you need to disable Xdebug for command line PHP scripts.


该选项不适用于通过网络浏览器提供的网页(例如Apache/nginx/IIS)或仅监听任何传入的调试连接(Zero-config approach ) 实际调试是在 IDE.

之外启动的

原因很简单: 为 CLI 脚本启动调试器时,IDE 启动您的 php 可执行文件(您配置的 PHP 解释器,例如 Windows 上的 php.exe)带有附加参数(-z:检查 php --help 输出或 here)可以加载此类附加扩展。

但是当你调试一个网页时,整个 PHP 不受 PhpStorm 控制:它是你的网络服务器(Apache/nginx/IIS/等)与 PHP 通信..你现阶段不能通过这样的论点。