问题描述
我尝试了您的新功能按需xedbug".我坚持使用这些指南( https://www.jetbrains.com/help/phpstorm/2016.3/configuring-xdebug.html 和 https://blog.jetbrains.com/phpstorm/2016/06/xdebug-on-demand-for-cli-php-scripts-in -phpstorm-2016-2-eap/).
I tried out your new feature "xedbug on demand". I stuck to these guides (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/).
当我将路径添加到PhpStorm可以识别的xdebug路径时,我在php Server菜单中看到了该路径(标签从未安装"切换为"XDebugger 2.4.1").
I see that in the php Server menu when I add the path to the xdebug that PhpStorm recognizes it (the label switches from "not installed" to "XDebugger 2.4.1").
所以一切似乎都很好,但是当我通过错误图标使用调试器时,它永远不会为断点附加/停止.
So everything seems to be fine but when I use the debugger via the bug-icon, it never attaches/stops for the breakpoint.
我激活了xdebug-Logfile,但它仍然完全为空.
I activated the xdebug-Logfile, but it stays completely empty.
此外,我在php.ini中注释了所有与xdebug相关的内容.
Furthermore I commented everything xdebug-related out in the php.ini.
xdebug-port仍在9000(默认)上.
The xdebug-port is still on 9000 (default).
有什么主意我可以做什么?
Any ideas what I can do about it?
更新:我正在通过phpStorm的"PHP Web应用程序"和debug-icon使用调试器.我正在调试通过apache vHost执行的php文件.
PS:检查了IntelliJ论坛和Stack帖子,尽管没有发现任何帮助...
PS: Checked IntelliJ forum and Stack posts, didn't find anything helpful though...
推荐答案
按需Xdebug"选项仅适用于CLI调试("PHP脚本"类型的运行/调试配置";也将起作用用于其他CLI模式配置,例如"PHPUnit"),无论是本地还是远程.
"Xdebug in demand" option works for CLI debugging only (Run/Debug Configuration of "PHP Script" type; will also work for other CLI-mode configs, e.g. "PHPUnit") be it local or remote.
引用上述简介博客文章:
该选项不适用于通过网络浏览器提供的网页(例如Apache/nginx/IIS),或者仅在侦听任何传入的调试连接时使用(零配置方法),其中实际调试是在外部进行的IDE.
That option does not work for web pages served via web browser (e.g. Apache/nginx/IIS) or when just listening for any incoming debug connections (Zero-config approach) where actual debug is initiated outside of IDE.
原因很简单::在CLI模式下启动调试器时,IDE会启动php可执行文件(您配置的PHP解释器,例如Windows上的php.exe
),并带有附加参数(-z
-检查php --help
输出或此处)可以加载此类内容额外的扩展名.
The reason is very simple: when launching debugger in CLI mode, IDE launches your php executable (your configured PHP Interpreter, e.g. php.exe
on Windows) with additional parameter (-z
-- check php --help
output or here) that can load such additional extension.
但是...当您调试网页时...然后整个PHP不受PhpStorm控制-它是与PHP通信的Web服务器(Apache/nginx/IIS/etc),并且您无法传递此类参数这里的此类脚本.
But ... when you debugging web page ... then whole PHP is not controlled by PhpStorm -- it's your web server (Apache/nginx/IIS/etc) that communicates with PHP .. and you cannot pass such argument to such scripts here.
这篇关于PhpStorm-xDebug按需未附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!