Disable display_errors and write them to a file. This is the standard procedure for any production website.
In the Apache configuration file php_admin_value error_reporting X should be impossible to override the user code, where X is the integer value you want.
In addition, set_error_handler() can be useful if you want to perform some execution checks.
Matthew
source share