Closed arturm11 closed 7 years ago
Did you actually check this with Wireshark? Can you try to log the value of statusCode
? Something fishy about that.
Thank you for reply. After some more investigation I have found "cgi.rfc2616_headers = true" in my php.ini. Changing back to default solves the problem. BTW there was a bug in my workaround. It should be:
if (substr(php_sapi_name(), 0, 3) == 'cgi')
header(sprintf('Status: %s %s', $this->statusCode, $this->statusText));
else
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
See: https://stackoverflow.com/questions/3258634/php-how-to-send-http-response-code
Thank you for that update! Much appreciated.
Response::send() doesn't set HTTP status in IIS FastCGI environment. My solution is to replace line:
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
with (PHP >= 5.4):http_response_code($this->statusCode);
or: