Configure Magento error page

Last modified by ckosny on Thu, June 24, 2010 16:16
Source|Old Revisions  

This is an old revision of the document!

If an server side error occurs, Magento by default redirects to a special page that displays the error message itself and a trace. While this is useful information such a display can be quite annoying:

During development you most likely do not want to be redirected, but see the error directly on the page where it occurred. This way you can simply reload the page after fixing the error.

On the live server it is not advisable to provide any details about an error for several reasons:

  • such information might give clues about how to attack the website
  • it is not very user friendly; most visitors will be confused when seeing such a page
  • the website admin is not informed of the error, unless a customer contacts him

Fortunately you can configure the behavior of Magento in case of errors.

Display errors on the same page (developer mode)

During development enable the developer mode so you will see all errors directly on the page where they happen. To do this open the index.php in the root of your Magento installation and remove the comment from the line


Provide feedback form for visitor and send error reports via email to admin

If an error occurs Magento can email the error to someone and also display a feedback form for the visitor asking for details.

To set this up go the the file


Change this line

  1. <action>print</action>

to this

  1. <action>print</action>

and add your email address in this line

  1. <email_address></email_address>


  1. <email_address></email_address>

Now you are done.

The next time an error occurs the following happens: Magento displays a page similar to this:

One email with the error message and the trace is sent to the configured email address. If the visitor submits the form, another email containing the submitted information is sent to the configured email address.