HTTP requests (file_get_contents, curl) times out when calling same server listener
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.2k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
Description
Issue
When a script makes a HTTP call on Windows to the same host/server listener - it will time out.
Steps to reproduce:
- Install PHP 8.2.8 for Windows
- Create
bug/test.phpfile with following code:
<?php
echo $_GET['say'] ?? file_get_contents('http://localhost/test.php?say=hello');
cd bugand start a php server in that folder:php -S localhost:80- Try to run the script, it will time out:
php test.php
The script will time out, as the file_get_contents never responds.
Expected result
It should echo hello to the console
Further testing
This issue extends further than file_get_contents and php web server - it also affects:
- curl functions
curl_execetc not justfile_get_contents - Using
php-cgi.exeand nginx on Windows withfastcgi_pass - Also tested with Caddy web server, using proxy pass, same issue
Linux/Unix
This doesn't affect linux. Trying the above reproduction steps in Linux will echo hello. It also works as expected when using WSL/Windows Sub System for Linux.
PHP Version
PHP 8.2.8
Operating System
Windows 10
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la reproducción en Windows en bug/test.php y compara file_get_contents('http://localhost/test.php?say=hello') con los casos documentados de curl_exec. Reproduce el problema usando PHP 8.2.8 y php -S localhost:80 en Windows; después, verifica que la solicitud se complete y devuelva hello sin provocar regresiones en el comportamiento de Linux/WSL.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- php
- Área
- backend, networking
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100