I use PHPStorm as my primary tool for debugging PHP and am very pleased. So far I've been using Firefox to run the scripts, and PHPStorm catches breaks perfectly.
Now I have a situation where I am running a PHP script via command line (not browser) and want to know if there's a way to setup PHPStorm to catch breaks when running a PHP script via command line?
To enable PHP Debuging with Xdebug on the shell/command line with Phpstorm is very easy:
export XDEBUG_CONFIG="idekey=PHPSTORM"
In windows CLI, use set instead of export.
set XDEBUG_CONFIG="idekey=PHPSTORM"
Ensure Phpstorm is listening to the PHP Debug connections.
To disable debugging from command line end:
unset XDEBUG_CONFIG
This (PHPSTORM) is the default Phpstorm IDE-Key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With