sudo apt-get install php-xdebugThis step might not be 100% necessary but I'm including it because it's one of the things I did in the process.
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back=1
xdebug.remote_log=/tmp/debug.logFrom your machine, run this command to create a tunnel on port 9000.
ssh -R 9000:127.0.0.1:9000 url-to-server
The serverName portion is used by PhpStorm to identify the server that's connecting to it so that it can use the appropriate path mappings and stuff.
PHP_IDE_CONFIG="serverName=servername" php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /path/to/script