Note: While my answer works, @Eric Woods answer is superior.
Ever since Xdebug 3 came out, I've had to use a .lando.php.ini file in order for it to work with Lando.
recipe: pantheon
config:
framework: drupal8
services:
appserver:
type: php
xdebug: true
config:
php: .lando.php.ini
overrides:
environment:
PHP_IDE_CONFIG: "serverName=appserver"
LANDO_HOST_IP: "host.docker.internal"
XDEBUG_CONFIG: "remote_enable=1 remote_host=host.docker.internal"
In the project's root folder, create a .lando.php.ini
.lando.php.ini
; Xdebug
xdebug.max_nesting_level = 256
xdebug.show_exception_trace = 0
xdebug.client_host = ${LANDO_HOST_IP}
xdebug.log = /tmp/xdebug.log
xdebug.mode = debug
xdebug.client_port = 9003
xdebug.start_with_request = yes
In your PHP storm settings, create the "appserver" by hitting the "+" icon. Make sure you add the /app
path to the root.
Note: Replace Host with your actual host name.