How to turn on error messages in magento 2
Add following code in index.php file :-
error_reporting(E_ALL);
ini_set('display_errors', 1);
Enabling Error reporting in magento2 is little tricky , as magento2 now comes with 3 different modes
- Default
- Developer
- Production
Magento2 by default install in “default” mode and thats why you dont get the error log at the front-end of the site , that can a viewed at magento error log . You may check the complete details over here http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html
How to enable developer mode in Magento2
This is must have if you are a developer and building extension and template for magento2 , magento provide a command for this purpose . Login in to your linux terminal and under magento execute
php bin/magento deploy:mode:set developer
and it will enable the developer mode under your magento instance for production mode you can set the mode to production or default .
still if you are experiencing in error reporting
you can give a try by renaming local.xml.sample to local.xml under pub/errors