I have been through every post I can find on this subject but I can not find a solution. So instead of pulling my hair out more, I'll post a question.
I have a Lando install (running Drupal 8, but I'm testing on a simple phpinfo()
script) with Xdebug confirmed to be running. Whenever I add a breakpoint and run the script it fails to stop.
custom Lando .ini for Xdebug:
[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
Output of 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
I had xdebug working without an issue in PhpStorm but no luck in VSCode.
After the latest release v3.0.22**
which includes support for xdebug 3 you will need the
xdebug: debug
andconfig: php
settings in your.lando.yml
a
.lando.php.ini
file withand the vscode configuration in
.vscode/launch.json
withport: 9003
Before and up to release v3.0.19
I was able to run lando xdebug with vscode using this configuration
.vscode/launch.json
and I did not include any lando
php.ini
config in my.lando.yml
that the official xdebug actually instructs