Here the following steps that will show you how to Debug technique in Magento 2:
Step 1: Permit the developer mode
Step 2: Permit Magento error notifications
Step 3: Permit php display errors
Step 4: Path hint
Debug is very essential for developer. Today, I will explain you how to debug in Magento 2.
Permit the developer mode:
- The first thing you should do is allow the developer mode. The command can save the run time so it automatically sends the JS / CSS file to the Pub / Fixed folder.
- To permit the developer mode, please visit to ssh, magento 2 root folder and enter the command:
php bin/magento deploy:mode:set developer
- Or you can visit to .htaccess file and don’t use the developer command
Permit Magento error notifications
As you know, when Magento has bug, it will inform you at the screen. However, you should go to the file to read the error. To study it at the web page screen, please visit to the folder pub/errors and rename file local.xml.sample to local.xml
Permit php display errors
To permit php exhibit bugs, please go to file: app/bootstrap.php and un-comment the line ini_set:
To permit the path hint, please visit to Store – Configuration and Advanced-Developer. In Debug, please select “Yes” and save configuration.
Last Update: April 7, 2018