I understand this has been asked a bunch of times and probably appropriately answered so I ask you give me some grace here. I want to log errors to the error log but NOT display them to the client and for some reason nothing I've tried is making any difference. I'm currently using error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
and my PHP.ini has the following for display_errors
:
display_errors = Off
I thought maybe the framework I'm using or some code was overwriting that value (possibly via ini_set()
) but if I ask PHP what the value is via:
$display_errors = ini_get('display_errors');
if ( filter_var( $display_errors, FILTER_VALIDATE_BOOLEAN) ){
echo "display_errors = true\n";
} else {
echo "display_errors = false\n";
}
I get false
(Note: I put the code at the end of the view/template for the framework). If I grep
or use VSCode to search the codebase for display_errors
I don't see any references that override the default behavior. If it makes any difference the actual value of display_errors
as reported by ini_get()
is an empty string ''
. In case it's not clear this is in the context of Apache2 (Apache/2.4.29) on Ubuntu. What am I missing? Is there a third flag around displaying errors? TIA
Edited:
Framework is CodeIgniter v2.2.6 as reported by system/core/CodeIgniter.php.
PHP 7.2.24-0ubuntu0.18.04.13.
Apache2 (Apache/2.4.29)