Req #66593 [Com]: Built-in web server should handle php://input as client socket
| From: | cmbecker69 at gmx dot de | Date: | Tue, 18 Feb 2014 23:12:15 +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-184352@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: cmbecker69 at gmx dot de
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:
> never mind this report.
It seems reasonable to close the ticket. :)
Previous Comments:
------------------------------------------------------------------------
[2014-01-29 12:43:27] chobieeee@php.net
Sorry, I've just misunderstood as
php://input. never mind this report.
------------------------------------------------------------------------
[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