I’ve had a hell of a time getting xdebug working locally with vscode, but now that I have, I thought I’d share.
installed this: https://github.com/felixfbecker/vscode-php-debug
ansible-version: 2.4.2.0
using chrome for debugging, and I did not install any chrome extensions
my launch.json config:
{
"version": "0.2.0",
"configurations": [{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"pathMappings": {
"/srv/www/example.com/current/web/app": "${workspaceRoot}/site/web/app"
},
"port": 9000
}]
}
example.com is the site name you are using. (you might be using something like http://example.dev or http://example.test, but your site name would be example.com)
I’m running this launch.json from the root of my project (ie the folder that contains trellis and bedrock)
first run vagrant up then run the debugger, throw in a breakpoint, then navigate to http://example.dev?XDEBUG_SESSION_START=XDEBUG_ECLIPSE
Hope this helps someone.
