Install xdebug with PECL.
sudo pecl install xdebug
Create the following file @ /etc/php5/conf.d/xdebug.ini
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_log="/tmp/xdebug.log"
Restart apache...
sudo service apache2 restart
Now SSH into that server using the following command.
ssh -R 9000:localhost:9000 [email protected]