Re: error handling

From: Date: Sun, 17 Nov 2002 17:51:10 +0000
Subject: Re: error handling
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124805@lists.php.net to get a copy of this message
Try this. In your php.ini file: display_errors = Off log_errors = On track_errors = On Then in your code: $php_errormsg = false; ob_start(); ... your code ... if($php_errormsg) { ob_end_clean(); // Error - discard buffer echo "An error occurred - webmaster notified"; } else { ob_end_flush(); // No error, send buffer } -Rasmus On Sun, 17 Nov 2002, Mattia wrote: > When the display_errors is Off, and the output of the page comes all in the > end, or when you're using some template engine or some output buffer > function (ob_start()), no output is displayed to the screen! I would like to > tell a message to the use in case of failure of the scripy, without giving > the information of the kind of error it is. > > Display a message like: the application has caused an error! the webmaster > has been notified by email. > > And the precise error in the error log, like: Parse error in line .... file > .... > > Is there anythig to do it without setting up a custom error log? > > thanks > Mattia > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#124805) next »