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
Setup 'server' configuration
Browser plugin
- install a browser plugin such as this one
- configure the ide key, here:
MY_AWESOME_KEY
- it is also possible to use bookmarklets
Enjoy!
- Puts breakpoints
- Enable cookie using web browser extension or bookmarklet
- Click on the bug icon called 'debug mode'
- You can now enjoy the debugger (inspect variables, control the execution flow)