FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Custom error-handling creates "500 internal server error"
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Custom error-handling creates "500 internal server error" [message #174408 is a reply to message #174406] Fri, 10 June 2011 12:30 Go to previous message
Luke is currently offline  Luke
Messages: 10
Registered: June 2011
Karma:
Junior Member
On Jun 10, 1:22 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
> (Please stop using Google groups latest greatest interface to usenet.
> Your answers appears as a fresh posting to many regular usenet (as in
> n-=gg). Not in theright thread, but as a new top posting. I understand
> that the former version does it right.)

Ok, using the old Google Groups now.


> It is hard for me to help you with the 200 and 500 headers without
> seeing the whole set-up: Where do the possible errors arise?

I found out the problem is this: I'm buffering the output to print one
(JSON-formatted) error message without any other text, no matter how
many errors occurred. That way I can return a valid JSON-Message to
AJAX-calls. If I relied on PHP's error-handling it would print error-
message anywhere in the code, so I wouldn't be able to send a valid
JSON-string. To do that I call

ini_set('display_errors', 0);

Now if ini_set('display_errors', 0); is set to suppress error-output
and an error occurs a 500 header is sent. I found out writing

error_reporting(0);

instead also suppresses error-output but does not send a 500-header if
an error occurs. That fixed it.

Still, thanks for your help.

Lukas
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Install GD on Windows
Next Topic: FDF extensions to PHP will not compile
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 21:31:16 GMT 2024

Total time taken to generate the page: 0.05477 seconds