RE: [PHP-DEV] error handling

From: Date: Thu, 21 Nov 2002 06:15:33 +0000
Subject: RE: [PHP-DEV] error handling
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-91385@lists.php.net to get a copy of this message
On Wed, 20 Nov 2002, John Coggeshall wrote: > |> And how about that we change PHP so that it changes > |> the status of the response to 500 on a fatal error? Then > |> you would be able to use the Apache directive > |> > |> ErrorDocument 500 /handle-my-errors.php > |> > |> to deal with them. You would have to use output buffering, > |> of course, but using output buffering is the only way to > |> shield your users from errors anyway. > | > |+1 !! > | > |Why didn't anyone think of this before? :) > > A couple of problems with that: > > 1) No way for handle-my-errors.php to know the details of the error such > as errorcode, file, etc) > 2) Relies on the web server (not PHP) to re-direct the user to another > script > > If we are willing to do this, think we're better off creating a > directive error_url which requires output buffering enabled and > re-directs the user to another URL with GET parameters containing the > error messages. If ErrorDocument is implemented as a sub-request in Apache, it would be enough for PHP to set one or more Apache notes with the necessary information. - Stig

« previous php.dev (#91385) next »