bernhard Posted December 3, 2018 Share Posted December 3, 2018 Anybody of you ever came across this error? Seems to be a problem of PHP FPM: https://github.com/php/php-src/pull/3363 What is my alternative? @adrian we use this method in the tracy request logger, so this might need to be changed! Edit: if (!function_exists('getallheaders')) { function getallheaders() { $headers = []; foreach ($_SERVER as $name => $value) { if (substr($name, 0, 5) == 'HTTP_') { $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; } } return $headers; } } This seems to fix it. If anybody has a better solution please let me know. 1 Link to comment Share on other sites More sharing options...
adrian Posted December 3, 2018 Share Posted December 3, 2018 Hey @bernhard - I have a slightly revised version that tweaks the returned array to exactly match getallheaders(). I'll implement this is Tracy shortly unless anyone else has any better ideas. $headers = []; foreach($_SERVER as $name => $value) { if($name != 'HTTP_MOD_REWRITE' && (substr($name, 0, 5) == 'HTTP_' || $name == 'CONTENT_LENGTH' || $name == 'CONTENT_TYPE')) { $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', str_replace('HTTP_', '', $name))))); if($name == 'Content-Type') $name = 'Content-type'; $headers[$name] = $value; } } 1 Link to comment Share on other sites More sharing options...
Recommended Posts