Just adding this for my future self’s health. First, update the PHP config file.
// Enable xdebug.
...
xdebug.mode=develop,debug
...
The VSCode launch file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www": "${workspaceFolder}",
},
},
]
}
Do not forget to update your .env file.
...
# Where to run WordPress from. Valid options are 'src' and 'build'.
LOCAL_DIR=src
# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
LOCAL_PHP=latest
# Whether or not to enable Xdebug.
LOCAL_PHP_XDEBUG=true
...
Beware of trying to make it work with AI; you may end up with some hallucinations and tons of files!

Leave a Reply