Req #66593 [Com]: Built-in web server should handle php://input as client socket

From: Date: Wed, 29 Jan 2014 12:43:28 +0000
Subject: Req #66593 [Com]: Built-in web server should handle php://input as client socket
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184075@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66593&edit=1 ID: 66593 Comment by: chobieeee@php.net Reported by: chobieeee@php.net Summary: Built-in web server should handle php://input as client socket Status: Open Type: Feature/Change Request Package: Built-in web server Operating System: N/A PHP Version: 5.5.8 Block user comment: N Private report: N New Comment: Sorry, I've just misunderstood as php://input. never mind this report. Previous Comments: ------------------------------------------------------------------------ [2014-01-28 11:06:01] chobieeee@php.net 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66593&edit=1

« previous php.bugs (#184075) next »