Debugging technique in Magento 2


Following are the steps that you will follow to Debugging in Magento 2:

Enable Developer mode

The first thing you must do is to enable the developer mode. So it will automatically deploy JS & CSS file to pub/static folder so you can save the time to run command each time you made changes in js & css file.

Enable the developer mode, from ssh,  go to Magento 2 root folder and enter the following command:.

php bin/magento deploy:mode:set developer

Or you can go to .htaccess file and uncomment the SetEnv MAGE_MODE developer line


Enable exception printing on the webpage in Magento 2

As we all know, when Magento has error, it will show us at the screen with message something like this Exception printing is disabled by default for security reasons. However, you must go to the file to read that error.

To read it at the web page screen, please go to the directory pub/errors and rename file local.xml.sample to local.xml.


Enable PHP display_errors

To enable PHP display errors, please go to file : {root}/app/bootstrap.php and uncomment the line ini_set('display_errors', 1).


Perform  each of the opening paragraphs earlier mentioned and you may do debugging in Magento 2. Expect our post can help. If you have any query in do debugging in Magento 2, leave it in the comment segment, I will response as soon as possible

php bin/magento deploy:mode:set developer
By | 2018-07-17T11:53:37+00:00 November 3rd, 2017|Debugging, Magento 2|

Leave A Comment