What’s the proper way to use PHP ini_set() for error_reporting? Is it by using quotes:
ini_set('error_reporting', 'E_ALL');
or without quotes:
ini_set('error_reporting', E_ALL);
When I use the one with quotes, my site_errors.log file doesn’t get populated. But when I use the one without quotes my site_errors.log file gets updated just fine. Here’s what my php file looks like:
// my php file
ini_set('display_errors', 'Off');
ini_set('error_reporting', E_ALL);
ini_set('log_errors', 'On');
ini_set('error_log', 'site_errors.log');
Without quotes.
E_ALLis a pre-defined PHP constant, essentially the result ofOnce you put quotes around it, it’s no longer a constant and PHP treats it as a plain string.
try this:
The “without” version will will be a number (2^31-1), while the “with” version will be the literal text
E_ALL.