FCGI

From Davical
Jump to navigationJump to search
  • add "Passheader AUTHORIZATION" to the apache configuration, e.g. in the fcgid.conf:
<IfModule mod_fcgid.c>
  AddHandler    fcgid-script .fcgi
  IPCConnectTimeout 20
  Passheader AUTHORIZATION
</IfModule>
 
  • For more recent versions of apache/mod_fcgid:
   Passheader AUTHORIZATION
 

has now been changed to:

 
    FcgidPassHeader Authorization
  

See http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html for mod_fcgid parameters. From my experience, this only seems to work correctly if you have a recent version of the module (I am using apache(2.2.14) with mod_fcgid(2.3.7-dev)). Otherwise, I have found that the authorization headers are not passed (enable header request debugging and check for your self). I'm not sure how this affects the way the authentication works. I haven't noticed any change, weather the headers are reported as having been passed or not, but I thought it worth mentioning should it become an issue in the future.

  • getallheaders() is only available for mod_php, replace it by putting this code into your *-conf.php:
if (!function_exists('getallheaders'))
{
    function getallheaders()
    {
       foreach ($_SERVER as $name => $value)
       {
           if (substr($name, 0, 5) == 'HTTP_')
           {
               $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
           }
       }
       return $headers;
    }
}

(above code taken from http://us.php.net/manual/en/function.getallheaders.php#84262)