sudo pecl install xdebug
sudo touch /etc/php5/mods-available/xdebug.ini
edit /etc/php5/mods-available/xdebug.ini and paste this content in to the file:
zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.show_local_vars=0
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
xdebug.show_exception_trace=0 (edited)
cd /etc/php5/conf.d/
ln -s ../mods-available/xdebug.ini 10-xdebug.ini
From PhpStomr you need to set up folder mapping
Run -> Edit configurations -> Default -> Php remote Debug ->Servers (select your app domain name) click in the [...] button and on the main folder edit to add the remote url /home/vagrant/code or whatever
Then drag bookmarks from this page to start debuger from browser
https://www.jetbrains.com/phpstorm/marklets/
Then you can click start debug bookmark on your browser, start listening in Phpstorm (Run -> Start listening for php connecions)