Error: duplicate header

Error: duplicate header

by Friedemann Wagner -
Number of replies: 7

Hello,

since a few months we test a moodle 1.9 system. Now I try to use HotPotatoes. But different (I tried JCloze and JCross) from moodle imported HotPot‑HTML‑sites create errors:

Internal Server Error

[…]

More information […] in the server error log.

Additionally, a 500 Internal Server Error was encountered while trying to use an ErrorDocument to handle the request.

In the server error log file I found this:

[Wed Oct 15 13:54:35 2008] [error] [client x.x.x.x] FastCGI: comm with server "/home/richtsbergt3/htdocs/cgi-bin/php-fcgi" aborted: error parsing headers: duplicate header 'Status', referer: http://t3.richtsbergschule.de/moodle/mod/hotpot/view.php?id=80

Is there any help with this problem?

With best regards

F. Wagner

Average of ratings: -
In reply to Friedemann Wagner

Re: Error: duplicate header

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

I think there is an answer here:

Could you try the solution suggested there and let us know if it works for you?

The file you need to modify is

  • mod/hotpot/attempt.php (around line 154)

thanks
Gordon

 

In reply to Gordon Bateson

Re: Error: duplicate header

by Friedemann Wagner -

Hi Gordon,
thank you for your quick answer. But it didn't work.

In 'attempt.php' I found:

 header("Status: 204");
 header("HTTP/1.0 204 No Response");

and changed to:

if(substr(php_sapi_name(),0,3)=='cgi'){
 header("Status: 204");
}else{
 header("HTTP/1.0 204 No Response");
}

What I get is an empty page from 'attempt.php'.
May be you have further advice?

With best regards
Friedemann Wagner

In reply to Friedemann Wagner

Re: Error: duplicate header

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Thanks for trying that. How about something simpler:
  • revert to this:

    header("Status: 204");
    header("HTTP/1.0 204 No Response");

  • and then add an "@" sign to tell PHP to ignore errors when sending a "status" header

    @header("Status: 204");
    header("HTTP/1.0 204 No Response");

  • if the above doesn't work, you could try commenting out the first line completely by adding a couple of slashes:

    // header("Status: 204");
    header("HTTP/1.0 204 No Response");

please let us know what happens

thanks !
Gordon
In reply to Gordon Bateson

Re: Error: duplicate header

by Friedemann Wagner -

Oh, shock,

I don't know whats going on. I changed the 'attempt.php' to the former version. But it behaves as described with an empty page.

May be I made an mistake? Where can I download a completely new file?

We have moodle 1.9 + (Build 20080330).

Thank you for your help.

Friedemann Wagner

In reply to Friedemann Wagner

Re: Error: duplicate header

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
you can download HotPot module for Moodle 1.9 from here:
Gordon
In reply to Gordon Bateson

Re: Error: duplicate header

by Friedemann Wagner -

Hello Gordon,

with this it seems to run:

// header("Status: 204");
header("HTTP/1.0 204 No Response");

At the moment I tried it only with a JCloze and it worked fine.

Thank you very much and all the best from

Friedemann Wagner

In reply to Friedemann Wagner

Re: Error: duplicate header

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Thanks Friedemann,
that's interesting to know.

It could well be that the line you commented out is not necessary at all, in which case we can take it out. I will check out a few server configurations that I have access to and try to verify whether removing the line would break anything. If not, then we can take that line out for good.

best regards
Gordon