1. Use the developer mode:
Developer mode: In this mode, static files are not cached, and system errors and exceptions are displayed to users. In this mode, there is no need to manage the external Internet traffic.
The developer mode is intended to be used and useful during development.
Here is 4 ways to change Magento 2 to developer mode:
- Command line:
php bin/magento deploy:mode:set developer
- Config file app/etc/env.php
'MAGE_MODE' => 'default'
'MAGE_MODE' => 'developer'
- Virtual Host
SetEnv MAGE_MODE developer
set $MAGE_MODE developer;
- Use .htaccess
you can go to .htaccess file and un-comment the developer command:
2. Display Magento error notifications:
Enable magento error notifications, please go to pub/errors and rename local.xml.sample -> local.xml
3.Enable php display errors:
Open file : app/bootstrap.php -> un-comment the line ini_set:
4. Enable template hints:
Go to admin panel:
For Front End:
Store > Configuration > Advanced > Developer > Debug > Enabled Template Path Hints for Storefront > Yes
For Admin :
Store > Configuration > Advanced > Developer > Debug > Enabled
Template Path Hints for Admin > Yes