How to Debug Magento 2 Code Using Command Lines

command linedebugmagento2

Running a script in command line is something we frequently do in Magento 2. For example, when creating new module, we must run setup:upgrade command. We cannot see all the information we need to know.

I know many Magento developers choose PHPStorm as their favorite editor. How we can use PHPStorm to debug Magento 2 command lines?

Best Answer

I configured "PHP Remote Debug" in PHPStorm and just add XDEBUG_CONFIG before script to start debugging.

like XDEBUG_CONFIG=idekey=phpstorm bin/magento setup:upgrade

Related Topic