我已经浏览了我能找到的关于这个主题的每一篇文章,但我找不到解决方案。所以我不会把头发拉得更多,我会发布一个问题。
我有一个 Lando 安装(运行 Drupal 8,但我正在测试一个简单的phpinfo()
脚本),并确认 Xdebug 正在运行。每当我添加断点并运行脚本时,它都无法停止。
用于 Xdebug 的自定义 Lando .ini:
[PHP]
Xdebug
xdebug.max_nesting_level = 256
xdebug.show_exception_trace = 0
xdebug.collect_params = 0
; Extra custom Xdebug setting for debug to work in VSCode.
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_host = ${LANDO_HOST_IP}
xdebug.remote_connect_back = 0
xdebug.remote_mode = req
xdebug.remote_autostart = On
xdebug.remote_log = /tmp/xdebug.log
xdebug.idekey = VSCODE
max_execution_time = 0
xdebug.log 的输出
245] Log opened at 2020-09-09 14:42:21
[245] I: Connecting to configured address/port: host.docker.internal:9000.
[245] I: Connected to client. :-)
[245] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///app/web/info.php" language="PHP" xdebug:language_version="7.3.22" protocol_version="1.0" appid="245" idekey="VSCODE"><engine version="2.9.6"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>
[245] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
[245] Log closed at 2020-09-09 14:42:21
我让 xdebug 在 PhpStorm 中没有问题,但在 VSCode 中没有运气。