Debugging Symfony2 Console Commands with XDebug and PHPStorm Debugging Symfony2 Console Commands with XDebug and PHPStorm symfony symfony

Debugging Symfony2 Console Commands with XDebug and PHPStorm


You should provide SERVER_NAME and SERVER_PORT. also you should enable xdebug.remote_autostart. Try this:

SERVER_PORT=<Your server port> SERVER_NAME='<Your server name>' php -dxdebug.remote_autostart=On app/console test


Make sure you have enabled xdebug inside php.ini CLI version not only apache/cgi php.ini.

[XDebug]xdebug.remote_enable = 1xdebug.remote_host = 127.0.0.1xdebug.remote_port = 9000xdebug.idekey = PHPSTORM


I'm suggesting to try following BASH helper command:https://github.com/torinaki/phpdebug-cli

phpdebug mostly autodetects all required configurations and you will not require to provide environment variables.

Just run:

phpdebug app/console bundle:console_command