Debugging a PHP CLI script

Kuba Florczuk
May 23 · 1 min read

Ever wonder how to debug CLI script with xdebugusing PhpStorm?

$ env XDEBUG_CONFIG=”remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0" path/to/script.php

Of course remember to first enable Start listening to PHP Connections.