Debugging Joomla! and Joomla! extensions with PhpStorm

Thanks to the zero-configuration debugger you can easily attach the PHP Debugger to an Joomla extension.

Requirements

Either use the bookmarks provided by PhpStorm (for enabling debug) or use the Chrome plugin Xdebug Helper.

Webserver / PHP with XDebug enabled and remote debugging turned on.

Browser Debugging

Activate the "Listen for debugger connections" in PhpStorm (Either over the icon on the top right or through the quick actions CMD + Shift + a)

Command line debugging

For command line debugging use the following export:

export XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1"

You can also add that to your .zshrc or .bashrc

See also: https://www.jetbrains.com/help/phpstorm/2016.1/configuring-xdebug.html