If your script cant find the function "getallheaders()" php might not be installed as Apache-module – saying that I have just had it happen even though it is!
function emu_getallheaders() {
foreach($_SERVER as $h=>$v)
if(ereg('HTTP_(.+)',$h,$hp))
$headers[$hp[1]]=$v;
return $headers;
}