Activities

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Enabling php error logging

1. Create a file where webserver can write

#touch /home/path/public_html/php_errors.log && chown -R 777 /home/path/public_html/php_errors.log

2. Create or add the following lines on .htaccess file

php_flag log_errors on
php_value error_log /home/path/public_html/php_errors.log

It also possible with enable the same values on php.ini file.

A sample .htaccess file will look like this

php_flag log_errors on
php_value error_log /home/path/public_html/php_errors.log
# prevent access to PHP error log

Order allow,deny
Deny from all
Satisfy All

How to hide the error and exception pages from the users. This will also increase the web security.
add this lines on either your .httacess line or php.ini file

For .httaccess,
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
For php.ini,
display_errors = Off
display_startup_errors off
html_errors off

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>