Today, Apache PHP application deployed to the Nginx, but found that the error: getallheaders () This function is not found.
It's amazing, this is not the default PHP function, how can I find it. But the problem is that there is only one way to find a solution.
Originally this function is the alias of the Apache_request_headers () function, see, with Apache pedigree, so nginx can not be used very normal.
Find the reason, or need a solution, in the PHP manual found the function of the writing, so excerpt down, convenient to view later:
<?phpIf(!Function_exists(' Getallheaders ')){functionGetallheaders(){Foreach($_serverAs$name=$value){If(Substr($name,0,5)==' Http_ ') { $headers [str_replace ( " '-' ucwords< Span class= "P" > (strtolower (str_replace substr ( Span Class= "NV" > $name 5= $value } } return $headers }} /span>
Workaround for PHP's getallheaders function to fail under Nginx