Last active
August 15, 2024 14:31
-
-
Save MatthieuScarset/0c3860def9ff1f0b84e32f618c740655 to your computer and use it in GitHub Desktop.
Correct settings for XDebug + VSCode + Lando (+3.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lando version is at least +3.0 | |
name: drupal-nine | |
recipe: drupal9 | |
services: | |
appserver: | |
webroot: web | |
xdebug: debug | |
config: | |
php: .vscode/php.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug (9003)", | |
"type": "php", | |
"request": "launch", | |
"port": 9003, | |
"log": true, | |
"pathMappings": { | |
"/app/": "${workspaceRoot}/", | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PHP] | |
; Xdebug | |
xdebug.max_nesting_level = 256 | |
xdebug.show_exception_trace = 0 | |
xdebug.collect_params = 0 | |
xdebug.mode = debug | |
xdebug.start_with_request = yes | |
xdebug.client_host = ${LANDO_HOST_IP} | |
; xdebug.log = /tmp/xdebug.log | |
; Remote settings | |
xdebug.remote_enable = 1 | |
xdebug.remote_autostart = 1 | |
xdebug.remote_host = ${LANDO_HOST_IP} | |
; xdebug.remote_connect_back = 1 | |
; xdebug.remote_log = /tmp/xdebug_remote.log |
Official guide: https://docs.lando.dev/guides/lando-with-vscode.html (based off of this gist).
Thanks @chrishappy but unless I'm wrong, the same link was already provided in the previous comment.
Ah yes. I didn't realize that link was also to the official guide. Maybe someone else would also be confused?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@karlkaebnick I do have Xdebug working with Lando and VSCode with this gist's settings.
PHP Debug is the VScode extension I use.
On some system, you have to open the port 9003 for debugging session to work, as follow for instance:
See the Known issues on Lando documentation for reference.