Skip to content

Instantly share code, notes, and snippets.

@lnoering
Created October 14, 2020 14:14
Show Gist options
  • Save lnoering/8b0455126fbd79c8eb6cde06614a26a4 to your computer and use it in GitHub Desktop.
Save lnoering/8b0455126fbd79c8eb6cde06614a26a4 to your computer and use it in GitHub Desktop.
xdebug for docker collection in vscode

Docker Collection

https://github.com/markshust/docker-magento#usage

Changes to have xdebug on with VSCODE.

Add this in xdebug.ini

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_port=9001
xdebug.remote_autostart=on
xdebug.remote_connect_back=on
xdebug.idekey=docker
xdebug.remote_log=/var/log/xdebug.log
xdebug.default_enable=on

Change the lauch.json in project folder.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9001,
            "log" : true,
            "stopOnEntry": true,
            "pathMappings": {
                "/var/www/html": "${workspaceFolder}/src"
            }
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9001
        }
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment