<?php /** * Get HTTP Auth to work with PHP+FastCGI * * @author Jacques Marneweck <jacques@php.net> * @license PHP License v3.01 */ /** * Get HTTP Auth to work with PHP+FastCGI */ if (isset($_SERVER["AUTHORIZATION"]) && !empty($_SERVER["AUTHORIZATION"])) { list ($type, $cred) = split (" ", $_SERVER['AUTHORIZATION']); if ($type == 'Basic') { list ($user, $pass) = explode (":", base64_decode($cred)); $_SERVER['PHP_AUTH_USER'] = $user; $_SERVER['PHP_AUTH_PW'] = $pass; } }
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Getting HTTP Auth to play nice with PHP run under FastCGI (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Suexec'ed PHP-FastCGI on Apa... in apache php fastcgi suexec
» My lighttpd php-fastcgi conf... in php fastcgi lighttpd
» Minimal extension-less build... in php fastcgi cgi
» Compile PHP5 with Fast-cgi s... in php fastcgi lighttpd
» PHP HTTP Connection class in php http
» How TextDrive does both PHP ... in php fastcgi lighttpd rails fcgi
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails