|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-01-29 12:43 UTC] chobieeee@php.net
[2014-02-18 23:12 UTC] cmbecker69 at gmx dot de
[2014-05-17 23:58 UTC] ajf@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: ajf
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 08:00:02 2025 UTC |
Description: ------------ Currently, Built-in web server handle php://stdin as STDIN. this behaviour may cause hang when reading raw POST data. almost php web application uses file_get_contents("php://stdin") for reading raw data (like json). Test script: --------------- # client.php <?php $data = "Hello World"; $length = strlen($data); file_get_contents("http://127.0.0.1:11111/", false, stream_context_create(array( "http" => array( "method" => "POST", "header" => "Content-type: application/octet-stream\r\nContent-Length: $length", "content" => $data, ) ))); # server.php (php -S 127.0.0.1:11111 server.php) <?php error_log(file_get_contents("php://stdin")); Expected result: ---------------- # server.php Hello World Actual result: -------------- // builtin web server waits console input.