I had to debug a command line PHP script that runs on a remote server and I could not figure out how to do it. I am using PhpStorm and XDebug.
PhpStorm comes with a rich set of configurations to run a PHP script, including a couple of presets for debug. I used them to debug web pages and command line scripts running on the local computer but nothing worked for scripts running on remote servers.
By reading the documentation of XDebug and PhpStorm I learned that some small tasks must be accomplished in order to make PhpStorm and XDebug co-operate for debugging.