2

Whenever we rebuild the catalog_product_flat index, Magento displays its standard error page along with a stack trace that reveals file structure to the outside world.

How do I stop this?

I've tried Googling "magento prevent display errors" but did not find anything relevant.

It doesn't seem to matter whether I comment the error_reporting(E_ALL | E_STRICT); line or these lines:

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

I also added this to the index.php file, to no avail:

ini_set('display_errors', 0);

I still want these errors logged in the var/reports folder, though.

  • Did you set MAGE_IS_DEVELOPER_MODE in .htaccess? If so, make sure your webserver allows setting custom global vars from within .htaccess. Some environments do not allow to do so, especially FCGI envs. But there are workarounds by putting a prefix to the vars. – Nicolas Dec 25 '14 at 7:13
  • Reports will always be written by Magento anyway. – Nicolas Dec 25 '14 at 7:20
5

You need to rename file errors/local.xml.sample to errors/local.xml in site document root. Then change node <action>print</action> to <action>email</action> and put your email in node <email_address>your_email@example.com</email_address>. All reports will be sent to this email.

  • And what if I don't want the errors emailed either? Printing them is obviously a security risk. But emailing them has resulted in throttling from Gmail when our server has sent out thousands of these emails to us. Why not just log them and be done with it? – Buttle Butkus Oct 11 '15 at 2:59
  • Feel free to use <action>none</action> It doesn't print exeption trace or send email (none taken out of the blue, just use a value other than print or email) – i42 Oct 12 '15 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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