Mobile app version of vmapp.org
Login or Join
Dunderdale272

: 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);

@Dunderdale272

Posted in: #ErrorReporting #Php

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);

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

2 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

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...

10% popularity Vote Up Vote Down


 

@Pierce454

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);

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme