Guide on how to setup XDebug on Vagrant (Homestead) with VSCode
Versions:
- PHP 7.1
- VSCode 1.16.1
- XDebug 2.5.5
- Vagrant 1.9.8
Guide on how to setup XDebug on Vagrant (Homestead) with VSCode
Versions:
This guide is based on Vagrant (Homestead 6), PHP 7.1, Xdebug 2.55, VSCode. Homestead uses Ubuntu 16.04
Add Homestead box to Vagrant. You can find more info about Laravel Homestead
Homestead folder has after.sh
, copy these LINES to after.sh to
install xdebug after initialization of vagrant.
Don't forget to specify php: "7.1"
in Homestead.yaml
at sites
Run vagrant up
or vagrant reload --provision
If everything is correct, you should see this lines after vagrant up
or vagrant reload --provision
Install VSCode and PHPDebug extension on local machine
Open VSCode -> click "Debug" -> click "Configure or Fix 'launch.json'"
Use this launch.json to setup PHPDebug extension.
Set breakpoint in any file, click on "Play" in debugger