﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
7361	Fixes for wp-app with PHP-CGI	yonosoytu	markjaquith	"I was trying to use Atom Publishing Protocol with my blog I a have found some quirks and bugs.

My blog is hosted at Dreamhost, and, as far as I know, is using Apache 2.0.61 and PHP 5.2.6 as CGI. My first problem was, obviously, the authentication, but neither the solutions from [http://codex.wordpress.org/AtomPub the Codex] or [http://joseph.randomnetworks.com/archives/2007/09/19/http-basic-authentication-a-tale-of-atompub-wordpress-php-apache-cgi-and-ssltls/ this other blog post] worked. Reserching seems like PHP5 as CGI doesn't forward HTTP_AUTHORIZATION header, and nothing seems to change its mind. But it seems to forward REMOTE_USER as REDIRECT_REMOTE_USER. With my patch and this code in the .htaccess the authorization seems to work:

{{{
RewriteCond %{HTTP:Authorization} !^$
RewriteRule wp-app.php wp-app.php [E=REMOTE_USER:%{HTTP:Authorization},QSA,L]
}}}

The other patch is to fix a bug in the wp-app.php code. It seems that when working with PHP as CGI, the ""Status:"" header needs to follow a specific format, with the number, and then the reason. The actual code (from Subversion, but it's there at least from version 2.5.1) do not send the number, making CGI/PHP/Apache to return with a ""500 Internal Server Error"" instead the ""401 Credentials Requiered"", confusing Atom clients. My other patch fixes this."	defect (bug)	assigned	normal	Future Release	AtomPub	2.9	normal		has-patch 2nd-opinion	josephscott rubys markjaquith kurtpayne
