php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66593 Built-in web server should handle php://input as client socket
Submitted: 2014-01-28 11:06 UTC Modified: 2014-05-17 23:58 UTC
From: chobieeee@php.net Assigned: ajf (profile)
Status: Closed Package: Built-in web server
PHP Version: 5.5.8 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chobieeee@php.net
New email:
PHP Version: OS:

 

 [2014-01-28 11:06 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-29 12:43 UTC] chobieeee@php.net
Sorry, I've just misunderstood as `php://input`. never mind this report.
 [2014-02-18 23:12 UTC] cmbecker69 at gmx dot de
> never mind this report.

It seems reasonable to close the ticket. :)
 [2014-05-17 23:58 UTC] ajf@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ajf
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 17:01:35 2025 UTC