Debug CLI apps with XDebug and PHP-FPM

Debugging CLI applications when using PHP-FPM.

Different configuration

Following from the earlier post I’ve quickly run into the need to debug CLI applications (namely Codeception powered tests) while relying on a PHP-FPM driven local development environment.
The solution falls into the same line of simplicity and leverages a shell alias I’ve presented in another post a while back; I’ve simply modified the first alias to instruct XDebug about the port it should try to connect:


alias xon="export XDEBUG_CONFIG=\"profiler_enable=1 remote_port=9009\""

not a rocket-science solution but still one that unstuck me.