I've got the PhpStorm 10.0.3 and trying to debug a CLI script that runs on a remote server.
I've got reverse SSH tunnel set up from my local machine to the remote server.
Remote server xDebug is configured with the following:
# /etc/php5/apache2/conf.d/20-xdebug.ini
# /etc/php5/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=true
xdebug.idekey=PHPSTORM
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
I try to start a script like this:
php -dxdebug.remote_autostart=On /var/www/index.php
The PhpStorm debug tabs get's opened (sometimes it's gray), but it does not prompt me to fix file mappings, it does not open the debugged file and does not point to the breakpoint line. The remote server script execution gets blocked until I manually kill the debugging session. 
When I debug over Apache2 using GET parameter:
?XDEBUG_SESSION_START=1
The debugging works fine and I get prompted to fix the file mappings.
Any idea why is that?
I was studying below, but it does not solve my problem: https://confluence.jetbrains.com/display/PhpStorm/Debugging+PHP+CLI+scripts+with+PhpStorm (Question: How my script should now that debugging should start without remote_autostart setting set? In green hint they say it is optional.)
and XDebug: how to debug remote console application? (Re: Setting the remote_host in the XDEBUG_CONFIG variable to my local computer external IP [check the copied bash snippet] does not seem to be working. My local computer is not accessible via external IP, it's only accessible via reverse SSH tunnel)
export XDEBUG_CONFIG="remote_host=$(echo $SSH_CLIENT | awk '{print $1}') idekey=PHPSTORM"
libphp5.so) is the same as the one at cli, and eventually fix the php.ini files if it is the case. php5 is for example only, use your own as appropriate.xdebug_break();in your code (a programmatic breakpoint -- will also initiate debug session). 2) Try use 9001 port for xdebug communications (in your case -- the port on server side; locally PhpStorm can still use 9000) -- TCP 9000 on a server may be already occupied by php-fpm (standard port for that tool) and in such case debug connection gets terminated almost instantly as it does not respond with expected output (debug protocol).