Xdebug is turned off by default, but you can turn it on by SSH’ing into VVV with vagrant ssh, and running the command switchphpdebugmod xdebug.You can turn it off by running switchphpdebugmod none.Keep in mind that some commands such as composer will run slower with Xdebug turned on. Once Xdebug is turned on, it will remain on until the next time VVV is provisioned.
Rampant Vagrant comes with XDebug installed and enabled in the guest OS by default with the IDE key of “vagrant”. With a tradeoff of performance, we are able to remotely debug our code in a tool such as PHPStorm. We’ll be configuring PHPStorm and Firefox to connect to a debugging session on the vagrant box.
First, get an instance of the RV project up and running. Also, open up PHPStorm on the host machine. I’m using the latest version of PHPStorm, 2016.3.2 as of writing this.
Save a new PHP file called debugTest.php within the public_html folder of the project with the following content:
- In order to make turning Xdebug on and off easy from within PhpStorm, set xdebug.remotestart = 1. By default it is 0 but setting it to 1 will allow the Xdebug listener toolbar button in PhpStorm to tell your Vagrant box that you want to use Xdebug. You can then proceed through the rest of PuPHPet’s process and generate your final manifest.
- Debugging with xdebug and PhpStorm The basic idea in PhpStorm is that you tell it where to look for the xdebug session (the “server”) and then you tell it how to link the files it’s running in the VM to the files found in the repo (called “mapping”). What follows are opinionated defaults, so adjust as.
- PHPStorm + XDebug + Vagrant. This question is about getting XDebug working in PHPStorm, when the project is running inside a local virtual machine which uses Vagrant. I haven't found any comprehensive manual how to get this running so far. Applies to PHPStorm 7.0. The things I would like to have covered in.
- 久しぶりにPHP環境を作った(Vagrant + PHPStorm + Xdebug). 12月から新しい環境でお仕事をさせていただくことになり、配属されるプロジェクトが Vagrant を使った PHP のプロジェクトということだったので思い出しもかねて環境構築してみた。.

Within PHPStorm, Click on File->Settings and select the PHP servers. I configured mine in this way:

Xdebug Phpstorm Vagrant
I added a new server and named it “Vagrant Server”. The Host is the hostname of our vagrant box, which for this project is “website.vbox.local”, and we’re using port 80. You’ll want to also map the absolute path on the server, using “/vagrant/public_html” to map to your project’s public_html folder.
Phpstorm Vagrant Xdebug Not Working
After saving the server configuration, select the Run menu and then Edit Configurations. Create a new PHP Remote Debug configuration with the following settings:
The Server name should match the same one we just created. Set the Ide key to ‘vagrant’. Then click Run->Debug ‘Remote Xdebug’.
Open debugTest.php within the IDE and add some breakpoints by either selecting a line and pressing Ctrl+F8 or clicking just to the right of a line number. A breakpoint is noted by a red circle on the left side.
Configure Xdebug Phpstorm
In the Firefox browser, install the extension EasiestXDebug. After installing the extension, click on its options and set the Ide key to match ‘vagrant’. Click the button in the browser to enable debugging.


Visit http://websiter.vbox.local/debugTest.php in the browser. The php file can now be stepped through. If you make a breakpoint at each line, you’ll note the temp array start with 3 elements and then loses the last array element as the unset command executes.
