problems running under php/fastcgi
-
FastCGI is very picky about there being only one “Status” header being sent from apps. So, if like me you are running wordpress under php/fastcgi, you get errors like this:
[Sat Apr 01 23:30:42 2006] [error] [client 66.215.220.80] FastCGI: comm with server “/var/www/fcgi-php/php” aborted: error parsing headers: duplicate header ‘Status’
This behavior is discussed on php bugs:
https://bugs.php.net/bug.php?id=36705According to php bugs, the resolution to this problem is at the programming level.
In wordpress, in file /wp-includes/functions.php there is the following two lines of code:
@header(“Status: $header $text”);
@header(“HTTP/1.1 $header $text”);In order to make wordpress play nicely with fastcgi, I had to replace those two lines with the following four lines:
if (substr(php_sapi_name(), 0, 3) == ‘cgi’)
@header(“Status: $header $text”);
else
@header(“HTTP/1.1 $header $text”);I’m hoping that the wordpress developers will incorporate this change into the next update of wordpress.
- The topic ‘problems running under php/fastcgi’ is closed to new replies.