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

From: Date: Sat, 17 May 2014 23:58:40 +0000
Subject: Req #66593 [Opn->Csd]: 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-185846@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
 Updated by:         ajf@php.net
 Reported by:        chobieeee@php.net
 Summary:            Built-in web server should handle php://input as
                     client socket
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Built-in web server
 Operating System:   N/A
 PHP Version:        5.5.8
-Assigned To:        
+Assigned To:        ajf
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2014-02-18 23:12:14] cmbecker69 at gmx dot de

> never mind this report.

It seems reasonable to close the ticket. :)

------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#185846) next »