Topic on Project:Support desk

ResourceLoader duplicate header Status on FastCGI

5
82.157.57.208 (talkcontribs)

Using MediWiki 1.17.0 on a server with FastCGI. After a few minutes, the css is not loaded anymore.

With Firebug I see that the URL http://example.com/mw/load.php?debug=false&lang=nl&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&* gives a 500 Internal Server Error.

In the apache log it says:

.. "/var/www/xxx/cgi-bin/php" aborted: error parsing headers: duplicate header 'Status', ..

In includes\resourceloader\ResourceLoader.php I found the following code in the respond() function:

header( 'HTTP/1.0 304 Not Modified' );

header( 'Status: 304 Not Modified' );

I found that FastCGI does not like it when you send a Status header like that. The problem disappears when I change these lines into:

if ( substr(php_sapi_name(), 0, 3) == 'cgi' ) {

@header("HTTP/1.1 304 Not Modified");

} else {

@header("Status: 304 Not Modified");

}

I wonder if this is the right solution (no way: hacking core is never the right solution). I googled and searched, but did not find anyone else with the same problem. Is FastCGI not used by many? Or is there something else very strange in my case only?

PHP 5.2.4 (FastCGI)

MediaWiki 1.17.0

MySQL 5.0.51a

😂 (talkcontribs)
194.246.123.103 (talkcontribs)

I'm getting an error 500 with the following URL, should I file another bug or is this related?

.../mediawiki/load.php?debug=false&lang=en&modules=jquery.checkboxShiftClick%2Cclient%2Ccookie%2Cplaceholder%7Cmediawiki.language%2Cutil%7Cmediawiki.legacy.ajax%2Cajaxwatch%2Cwikibits&skin=vector&version=NaNNaNNaNTNaNNaNNaNZ

(lighttpd/1.4.28, php-cgi 5.3.3-7+squeeze3, Mediawiki 1.17.0)

😂 (talkcontribs)

Sounds like a different bug. "Error 500" is really vague, so you might want to see Manual:How to debug.

194.246.123.103 (talkcontribs)

Thanks for the hint. However, once ini_set( 'display_errors', 1 ) is set, the error goes away. With only error_reporting set in LocalSettings.php, the error does not show up. I think I'll better head off to a mailinglist for this one. Thanks for replying though! -- 194.246.123.103 23:17, 18 July 2011 (UTC)

Reply to "ResourceLoader duplicate header Status on FastCGI"