Security – How to Prevent Error Log Display to the Public

Security

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.

Best Answer

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.

Related Topic