Fork me on GitHub

Configure xdebug with phpstorm with a vagrant box post

After loosing a few hours reconfiguring xdebug, phpstorm and vagrant, I found this great ressource. Here are my notes about it:

phpstorm is installed on the hostmachine and the app is running in a vagrant box.

Vagrant guest machine setup

sudo apt-get install php5-xdebug

Edit /etc/php5/mods-available/xdebug.ini :

xdebug.remote_enable=true
xdebug.remote_connect_back=true
xdebug.idekey=MY_AWESOME_KEY

Phpstorm setup

Setup 'php remote debug' configuration

screenshot

Setup 'server' configuration

screenshot

Browser plugin

Enjoy!

  • Puts breakpoints
  • Enable cookie using web browser extension or bookmarklet screenshot
  • Click on the bug icon called 'debug mode'
  • You can now enjoy the debugger (inspect variables, control the execution flow) screenshot

Categories: dev, phpstorm, xdebug