Skip to content

Instantly share code, notes, and snippets.

@MatthieuScarset

MatthieuScarset/.lando.yml

Last active Jul 25, 2020
Embed
What would you like to do?
Correct settings for Xdebug + VSCode + lando
name: agr-003
recipe: drupal8
config:
webroot: docroot
xdebug: true
conf:
php: .vscode/php.ini
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
// "localSourceRoot": "${workspaceRoot}/", // Deprecated
// "serverSourceRoot": "/app/", // Deprecated
"pathMappings": {
"/app/": "${workspaceRoot}/",
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
[PHP]
;;;;;;;;;;;;;;;
;IMPORTANT;
;PLACE THIS FILE UNDER .vscode folder;
;SO IT DOESNT GET COMMITTED;
;;;;;;;;;;;;;;;
; 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_autostart = 1
@smk

This comment has been minimized.

Copy link

@smk smk commented Feb 13, 2018

It's not necessary to duplicate Lando's default php.ini, since the custom php.ini is loaded additionally to any existing PHP configuration.

@MatthieuScarset

This comment has been minimized.

Copy link
Owner Author

@MatthieuScarset MatthieuScarset commented Mar 3, 2018

Totally right, thank you for your comment @smk. I've update php.ini with XDebug settings only.

@redrambles

This comment has been minimized.

Copy link

@redrambles redrambles commented Nov 6, 2018

Thank you!

@MatthieuScarset

This comment has been minimized.

Copy link
Owner Author

@MatthieuScarset MatthieuScarset commented Jul 25, 2020

Code needs an update for Lando v2+ version.

Please read this official documentation instead.

NB:
For Unix users, there is often a known issue with port - preventing XDebug to work in VSCode.
You simply need to manually open your port 9000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.