I have a custom functionality added in our application in customer page in admin part of our Magento application. That custom functionality, a form that saves custom field of customers and sends an email, gives me a success message and an error message like this

An error has occurred. Please contact your site administrator.

The data are saved properly but the email is not sent.

My question is if there is a setup for magento to debug mode, so that it can tell me where does that come from.

3 Answers 3


You can look into the var/report folder and see the report corresponding to your exception number that is printed on the error page.

That will give you details about the error.

You can also check the var/log/system.log and var/log/exception.log files.


Take a look in your root index.php file. There's a block for


From there you can either add a line to your root .htaccess file, something like


or if you don't have access to the root .htaccess file, just go into your root index.php file and set the $_SERVER variable before the check like


and that'll activate Magento's developer mode and give you some more insight into what's going on. From there you could do what Digital Pianism suggested and check out your var/report folder, var/log/system.log, and var/log/exception.log. Depending on what the error is, it might be in your web server's error log as well.

Past that, if you've got a local build, you could install the XDEBUG PHP extension and plug it into an IDE (Eclipse, Netbeans, PHPStorm) and then step through the code with breakpoints to see exactly what's throwing the error.


Temporary comment if for developer mode in index.php as bellow

//if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.