https://roots.io/trellis/docs/installing-trellis/
Follow this guide: https://code.visualstudio.com/Docs/languages/php
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug
No need to install xdebug on your local machine.
Replace XXXXXXXXXX with example.dev
or whatever from trellis/group_vars/development/wordpress_sites.yml
wordpress_sites:
example.dev: // <-- This
---------------------------------------
{
"version": "0.2.0",
"configurations": [{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"serverSourceRoot": "/srv/www/XXXXXXXXXX/current/web",
"localSourceRoot": "${workspaceRoot}/site/web",
"port": 9000
}, {
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}]
}
Download xdebug extension for your browser https://xdebug.org/docs/remote. Links under Starting The Debugger
header.
Enable debugging in the browser extension. Press F5 in VS to start debugging. Voilá!