Docker breaks PHP file_get_contents() and http(s) stream wrappers?

I can confirm the very similar behavior after upgrading to 4.15.0.

Using PHP 7.4.33, any calls (http:// and https://) to IIS servers with file_get_contents() and related functions hung up until they hit the timeout limit.

Connections to non-IIS servers worked fine. Also wget from the container shell worked even for the IIS hosts.

I also inspected the connections with Wireshark just as @jamiecarl and noticed the same phenomen. Connections were HTTP/1.1 even if they were specifically set to HTTP/1.0 in PHP stream context options.

This seems to confirm Jamie’s theory, that the underlying issue with PHP streams was brought into daylight because of the connection change from HTTP/1.0 to HTTP/1.1 caused by Docker Desktop v4.15.0.

Uninstalling 4.15.0 and re-installing 4.14.1 fixed the issue for me too.

2 Likes