Seravo / wordpress

The WordPress project layout used by many of Seravo's customers, suitable also for local development with Vagrant and git deployment
https://seravo.com
GNU General Public License v3.0
102 stars 54 forks source link

Xdebug v3 remote step debugger config missing #200

Open jaakkolehtonen opened 1 year ago

jaakkolehtonen commented 1 year ago

Hi, seravo/wordpress:development docker image ships with xdebug v3 but configuration (/etc/php/7.4/fpm/conf.d/20-xdebug.ini) is still for v2.

This fixes remote step debugging in v3:

docker-compose exec --user vagrant wordpress bash

sudo nano /etc/php/7.4/fpm/conf.d/20-xdebug.ini

# Append these to end of file
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
xdebug.log=/data/log/xdebug.log

wp-restart-php
jaakkolehtonen commented 1 year ago

Im using VSCode for step debugging with following config and everything works great:

.vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "pathMappings": {
                "/data/wordpress/htdocs/": "${workspaceRoot}/htdocs/"
            }
        }
    ]
}

.vscode/settings.json


{
  "php.debug.ideKey": "vagrant"
}
frimro commented 1 year ago

Hi, this should be fixed in seravo/wordpress:nightly. We're still testing and ironing out some stuff before we're comfortable releasing a new version for the development tag. But if you could give the nightly version a spin and test that everything works nicely on your end too, that would be appreciated.