Skip to content

Instantly share code, notes, and snippets.

@cfaria
Last active November 17, 2020 16:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfaria/71d9c5d05542ee9072d1f81595e54dff to your computer and use it in GitHub Desktop.
Save cfaria/71d9c5d05542ee9072d1f81595e54dff to your computer and use it in GitHub Desktop.
Vagrant Scotch Box 3.5 with XDebug and configuration for debugging with VSCode

Enter the vagrant machine with
ssh vagrant

Install xdebug

sudo apt-get update
sudo apt-get install php-xdebug

Config PHP to accept xdebug connections
sudo nano /etc/php/7.0/apache2/php.ini

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1

VSCode configuration

{
  "name": "Listen for XDebug",
  "type": "php",
  "request": "launch",
  "port": 9000,
  "pathMappings": {
    "/root/to/the/web/in/vagrant": "${workspaceRoot}/root/to/web/on/local/project"
  },
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment