Posts log errors to text
Post
Cancel

log errors to text

source http://perishablepress.com/advanced-php-error-handling-via-php/

1
2
3
4
5
6
7
8
9
//php.ini
;;; php error handling for production servers
display_startup_errors = off
display_errors = off
html_errors = off
log_errors = on
docref_root = 0
docref_ext = 0
error_log = /var/log/php/errors/php_error.log

OR on the PHP file :

1
2
3
4
5
6
7
//http://stackoverflow.com/a/3531852
ini_set("log_errors", 1);
ini_set("error_log", "/tmp/php-error.log");
error_log( "Hello, errors!" );
Then watch the file:

tail -f /tmp/php-error.log

origin - http://www.pipiscrew.com/?p=2300 php-log-errors-to-text

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags