Magento 1.x: Enabling/Viewing Full Error Display

In Magento 1.x, the full error display on frontend is disabled by default. This article shows different methods on how you can see the full error message on your Magento 1 website.

Method 1: View full error from var/report folder

By default, you will see the following message if any Magento-related error happens in your code.

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 1216554711619

magento error report

Note the error log record number in the above message, i.e. 1216554711619.

The full error will be present in your Magento root and inside folder var/report. Inside your-magento-root-folder/var/report, you just have to search for the file with name of the error log record number present above in the error message displayed, i.e. 1216554711619.

So, the error is in file var/report/1216554711619.

Method 2: Rename errors/local.xml.sample file

You can simply rename one XML file and then you can see the full error display on the browser itself.

  • Go to your Magento root directory
  • Then, go inside folder errors
  • There, you will see a file named local.xml.sample
  • Rename it to local.xml, i.e. remove the “.sample” from the name of that file.
  • Refresh Cache from your Magento Admin (System -> Cache Management).

That’s all. Now, you should be able to see the error on the browser itself when you browse your Magento website.

Note: This way of enabling to show error on frontend browser view is not recommended in the production environment. It’s only good for the development environment.

Method 3: Edit .htaccess file

You can edit .htaccess file of your Magento website to:

  • enable Magento’s developer mode
  • enable PHP’s error display settings

Open your site’s .htaccess file and write the following at the end of that file:


SetEnv MAGE_IS_DEVELOPER_MODE "true" ## enable Magento's developer mode
php_value display_errors on ## enable PHP's error display settings
php_value error_reporting -1 ## set error display to E_ALL

That’s all. Now, you should be able to see the error on the browser itself when you browse your Magento website.

Note: This way of enabling to show error on frontend browser view is not recommended in the production environment. It’s only good for the development environment. When you go to production, i.e. when the site is live, then comment out the above lines of code from your .htaccess file.

Method 4: Edit index.php file

Although editing .htaccess file is the preferred one, I just want to show that you can edit index.php file as well to enable error display on your Magento site.

  • Open your site’s index.php file.
  • Find the following lines of code in index.php file:

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);
  • Add the following to it:

a) Set the SERVER variable MAGE_IS_DEVELOPER_MODE as TRUE
b) Set PHP Error Reporting as E_ALL (i.e. Report all PHP errors)
c) Enable PHP error display

So, the above lines of code in index.php file will be updated as follows:


$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true; # Set the SERVER variable
error_reporting(E_ALL); # Set Error Reporting as E_ALL (Report all PHP errors)

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

ini_set('display_errors', 1); # Un-commenting this line to enable PHP error display

That’s all. Now, you should be able to see the error on the browser itself when you browse your Magento website.

Note: Enabling Error Display on Frontend is only good for Development Environment. Undo your changes when you move to Production.

Hope this helps. Thanks.