EDIT: This does not apply if your setting was set using php_admin_value
or php_admin_flag
. Thanks to jaydisc for enlightening me about this fact. The answer lay in the display_error
directive, which governs the display of errors instead.
However, I am leaving the rest of the post here because based on the question title, this would be a possible answer if not for the php_admin_value
setting.
Error Reporting Difference between 1.7.x and 2.x
Regardless of your error_reporting
settings, Codeigniter overwrites it in the index.php
. http://php.net/manual/en/function.error-reporting.php
The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script.
This is as error_reporting
belongs to a family of ini_set
functions: http://php.net/manual/en/function.ini-set.php, which override php directives for the duration of the script, including the php_admin_value.
For 1.7.x, (looking at old versions here http://ellislab.com/codeigniter/user-guide/installation/downloads.html),
the first line of code in index.php
is
error_reporting(E_ALL);
, which enables errors no matter what (unless the setting is changed via the code later).
For 2.1.4, (https://github.com/EllisLab/CodeIgniter/blob/2.1.4/index.php) it depends on the ENVIRONMENT
constant:
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}