Dreamhost is different from my previous web hosters in that it runs PHP as a CGI, and not as a Mod-PHP integrated with Apache. This mostly makes no difference, but has caused me one problem: HTTP AUTH password authentication using the $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] doesn't work anymore. Since it took me a while to find a workaround, here's the skinny:

The workaround is to pass the username and password info as an environment variable to the script. You do this using mod_rewrite in your .htaccess file in the following way:

RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

This defines an environment variable named "HTTP_AUTHORIZATION" and stores all HTTP AUTH credentials in there before your script gets run. Next step is to grab your login info from there in your PHP script:

// split the user/pass parts
if( !isset($_SERVER['PHP_AUTH_USER']) )
{
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
if( strlen($_SERVER['PHP_AUTH_USER']) == 0 || strlen($_SERVER['PHP_AUTH_PW']) == 0 )
{
unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);
}
}

Here we first check if we need to do anything at all. If we get a username, we must obviously be running under mod_php, so no need to do anything. However, if we don't have a password, try to get one from the environment variable, to work around the PHP CGI limitations. We extract the "username:password" string into the $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] variables, where they would be on a regular mod_php system. But sadly, we may get two empty strings from this process if there was no password passed, so in that case we unset the two variables again, so that it behaves just like it usually would if no password was provided, and all our code can check it with isset($_SERVER['PHP_AUTH_USER']) as usual.