Bear in mind that contrary to the behavior of web browsers, file_get_contents doesn't return the result when the web page is fully downloaded (i.e. HTTP payload length = value of the response HTTP "Content-Length" header) but when the TCP connection is closed.

---

tcpdump makes clear that file_get_contents is still waiting for [FIN, ACK] when the HTTP response has been received one minute ago.

Although OS HTTP server answers 'Connection: close' in all versions, it does not actually close the connection since commit bcb27d4 or over. Try: