Edit report at https://bugs.php.net/bug.php?id=80931&edit=1
ID: 80931
Comment by: taylorgodiva28 at gmail dot com
Reported by: gilperon at gmail dot com
Summary: file_get_contents() hangs with HTTP/1.1 if server
doesn't close connection
Status: Verified
Type: Bug
Package: Streams related
Operating System: any
PHP Version: 7.4
Block user comment: N
Private report: N
New Comment:
i want to follow how people fix this problem, i am also facing the same situation in
(geometrydashscratch.io/)github.com
Previous Comments:
------------------------------------------------------------------------
[2023-09-20 11:49:56] taylorgodiva28 at gmail dot com
i want to follow how people fix this problem, i am also facing the same situation https://gist.github.com/kelunik/c82ce751c1c203806b10ef7326f3e56a
in
------------------------------------------------------------------------
[2023-08-10 16:52:34] r dot hessel dot git at gmail dot com
Same issue, oddly only on Linux.
Have 2 devs using docker on WSL2 and 1 using Linux Mint, and a UAT environment on Jelastic, all with
the same docker container.
The windows WSL2 users have no issue, but the linux mint environment does, and so does the Jelastic
UAT.
Tested with these docker containers:
jelastic/nginxphp:1.22.1-php-8.1.14
jelastic/nginxphp:1.24.0-php-8.1.21
Details on the Linux Mint version:
Linux Mint 21.2 (ubuntu 22.04.2 based)
Docker version 24.0.5, build ced0996
------------------------------------------------------------------------
[2023-05-25 09:59:10] nguyenthuongzl633 at gmail dot com
The PHP website is every time give us very imp info. all time our work is easy.
(https://www.paybyplatema.one/)github.com
------------------------------------------------------------------------
[2023-01-12 18:06:59] tgross at m-s dot de
I can confirm this problem when using php inside a docker 4.15.0 container.
try these docker commands (In my case, I call them inside WSL2 using Docker Desktop):
This one works well (it returns fast):
> docker run --rm php:7.3 php -d default_socket_timeout=10 -r "file_get_contents('https://github.com/');"
while this one hits the timeout (in this case, 10 seconds) (remove spaces from url!):
> docker run --rm php:7.3 php -d default_socket_timeout=10 -r "file_get_contents('https
> : // www . google . com /');"
It's basically the same with PHP 7.4, 8.1, 8.2. However, with PHP 8.1 and 8.2, the command
reaches twice the timeout - so it takes 20 seconds instead of 10!
Not only file_get_contents() is affected by this problem, but also SoapClient::__construct(), for
example.
------------------------------------------------------------------------
[2023-01-09 15:14:46] dominik+phpnet at komail dot ch
I can confirm the issue of Jamie, that file_get_contents() hangs indefinitely, if it's calling
an URL in the web from a docker container. This started to occur when we updated to the latest
docker version. I'm not sure, in which version exactly, though.
Currently using php8.1 and docker4.15
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80931
--
Edit this bug report at https://bugs.php.net/bug.php?id=80931&edit=1