Click Fraud Protection
PHP related blog, freelancer to hire!

FastCGI and PHP Auth (HTTP_AUTH) problem solved

There is a problem with Authorisation headers and php running as FastCGI. To solve it you need to tell FastCGI to pass authorisation headers and then translate it back to PHP

So in your vhost file or .htaccess file do:

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.+)
RewriteRule ^(.*)$ $1 [E=HTTP_AUTHORIZATION:%1,PT]

Then in your fastcgi conf file add

FastCGIConfig -pass-header HTTP_AUTHORIZATION

Leave a Reply