Wednesday, August 27, 2008

Enable private PHP Error Logging via .htaccess\disable PHP Error Logging for visitor

To hide PHP errors from visitors insert the following code in .htaccess

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

Once disable the error logs for visitors enable the private PHP error logging by using following code in .htaccess

# enable PHP error logging
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log

The PHP_errors.log file needs to be permission 755 or 777.

Also refer following blog to collect more information http://theperfectarts.com/

1 comment:

soman said...

Hi

nice tut. I also design a website in PHP and looking for this.

thanks