HTTP Basic auth and FastCGI

I've been bitten twice by this, so I thought to share the solution.
The problem is that, if you use fastcgi(+suexec) your php scripts won't see $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] and scripts that rely on it (obviously) won't work and keep asking credentials.