: Is it possible to entirely disable the ability to set error_reporting? I'm wondering if at the server level I can disable the ability for scripts to override error_reporting and ini_set('display_errors',1);
I'm wondering if at the server level I can disable the ability for scripts to override error_reporting and ini_set('display_errors',1);
Edit: I know how to disable errors using .htaccess and on a script by script basis. What I am trying to do is disable the ability to override error settings entirely so our developers actually fix their issues and not hide behind a error_reporting(0); ini_set('display_errors', 0);
More posts by @Dunderdale272
2 Comments
Sorted by latest first Latest Oldest Best
You should be able to use the disable functions feature built into PHP. That will prevent them from even calling ini_set or error_reporting in the first place.
Add to php.ini:
disable_functions = error_reporting,ini_set,shell_exec,etc...
If you add these lines to your .htaccess it should do the job for the entire site.
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors off
If you want to do it on a script by script basis
From the PHP manual at php.net/manual/en/function.error-reporting.php and found by doing a search for 'disable php error reporting'
error_reporting(0);
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.