Awesome! this also worked for me
Iām using Windows 11 > Docker (with WSL2) > DevKinsta > WordPress Site
Considering that PHP 8.x broke some functionalities, Iāve switched to 7.4 on DevKinsta.
On Windows power shell, access to docker bash:
docker exec -it devkinsta_fpm bash
then change directory where xdebug ini is:
cd /etc/php/7.4/fpm/conf.d
Modify file: vim 20-xdebug.ini
Add:
zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
xdebug.client_port=9999
xdebug.idekey = VSCODE
xdebug.log = /var/log/fpm/xdebug.log
xdebug.log_level = 1
Save file, then exit docker devkinsta_fpm bash
Finally on Windows power shell restart docker with:
docker restart devkinsta_fpm
Configure .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9999,
"pathMappings": {
"/www/kinsta/public/YourSiteName": "${workspaceRoot}"
}
}
]
}
Rembember to change YourSiteName
with your app name.