HTTP requests (file_get_contents, curl) times out when calling same server listener
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
bug/test.php で Windows 上の再現から始め、file_get_contents('http://localhost/test.php?say=hello') と、文書化されている curl_exec のケースを比較します。Windows で PHP 8.2.8 と php -S localhost:80 を使用して再現し、その後、リクエストが完了して hello を返すこと、また Linux/WSL の動作にリグレッションがないことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- backend, networking
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100