Remote CLI debugging with XDebug
This blog post is older than 4 years and may no longer be valid.
1 min read

Remote CLI debugging with XDebug


There are quite some tutorials out there on how to use XDebug to debug PHP CLI code, which where more confusing than helpful (to me). I found out that, once you have a running XDebug configuration, it is very easy to debug on the console, particularly with phpStorm.

Simply run the following line once

export PHP_IDE_CONFIG=serverName=www.domain.com ; export XDEBUG_CONFIG=idekey=PHPSTORM

(after customizing it to your needs, of course), set your breakpoints and run the script. That’s already it. You can also put this into your .bashrc file.