Magento2 Turn On Error Messages


Magento2 Turn On Error Messages : Error messages in any framework plays an important role when the project is in development mode. Magento2 provides the three mode default, developer and production mode. Here in this tutorial we are going to explain how you can enable error messages in magento2.


Magento2 Turn On Error Messages

Magento2 Provides the following modes –

  • Default- By Default this mode is set when we install magento2. Error messages will not be visible on frontend site. Error can be seen in log files.
  • Developer – Set developer mode if you are working with magento2.

    Magento2 Set Developer Mode-

    Run the below script to set developer mode in magento2 –

    php bin/magento deploy:mode:set developer

    if you run this it will set developer mode and error messages will be visible on site.

  • Production- No error messages & warnings will be displayed on frontend site.

Other Solution

Let’s have look over other solutions.


You can also add the following lines in index.php(located at root) at the top of file to enable errors.

Magento2 Turn On Error Messages:

error_reporting(E_ALL);
ini_set('display_errors', 1);

Advertisements

Add Comment

📖 Read More