I need help preventing PHP errors from displaying in the browser
How do I stop PHP errors from displaying to users?
I've tried this code at the top of my PHP script:
PHP Code:
ini_set ('error_reporting', E_ALL ^ E_DEPRECATED);
ini_set ('display_errors', 'off');
ini_set ('log_errors', 'On');
ini_set ('error_log', 'path to my log');
...and this code in "Edit .htaccess source:
Code:
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /path to my log
# [see footnote 3] # php_value error_reporting 999999999
php_value error_reporting -1
php_value log_errors_max_len 0
<Files errors.log>
Order allow,deny
Deny from all
Satisfy All
</Files>
However neither seems to be working as errors still show up on screen. Also, how should I describe the "path to my log" in each case? Right now the path in the PHP file is described relative to the public page that causes the error, and the path in the .htaccess file is described relative to the location of the .htaccess file . Thanks.