You need to find and remove some calls to the error_reporting()
PHP function. This is set by the main index.php file in EE, and is often changed by extensions and other add-ons. You'll need to search through your whole codebase to make sure to remove all of these calls.
The main culprit is the following section of index.php. When you have $config['debug'] = 1;
or $config['debug'] = 2;
set, the DEBUG
constant here will be set to 1
. If you have $config['debug'] = 0;
, DEBUG
will be 0
.
Old block:
/*
* --------------------------------------------------------------------
* Set the error reporting level
* --------------------------------------------------------------------
*/
if (DEBUG == 1)
{
error_reporting(E_ALL);
@ini_set('display_errors', 1);
}
else
{
error_reporting(0);
}
New block:
/*
* --------------------------------------------------------------------
* Set the error reporting level
* --------------------------------------------------------------------
*/
error_reporting(E_ALL);
if (DEBUG == 1)
{
@ini_set('display_errors', 1);
}
else
{
@ini_set('display_errors', 0);
}
This new block ensures that error_reporting()
is always on, but disables showing the errors if the user does not match the requirement set by your $config['debug']
value.
You may want to search your installed add-ons for ini_set()
calls that override the error_log
and more importantly display_errors
values, since this would cause the errors to not be logged properly and/or to be shown even when the user is not an admin.