Evert | Rooftop wrote:
Excuse me if this has been discussed before, but I would like to know
the stance on this issue, it's hard to search the buglist or mailing
archives on stuff like http, 500 and fatal.
Would it be hard to implement an ini setting for throwing a http 500
error on a fatal error? It's hard to make certain applications and have
proper error handling if there is no way to do anything on a fatal error..
It would be even grander if php could try to run a fall-back script when
something really bad happens, but just having that 500 on fatal errors
would be awesome ..
If this is not going to happen anytime soon, would you accept a patch?
How would you implement it. Fatal errors can happen after output has
already been sent in which case it is too late to change the http
status. And if you haven't sent anything yet, as in you are using
output buffering, then it is rather trivial to do in user space. Simply
start you script by setting the status to 500 and change it to 200 when
you know you have good output to send. That way if a fatal error
happens, the 500 will be sent.
-Rasmus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php