php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30722 php://input causes hanging of web scripts
Submitted: 2004-11-08 21:06 UTC Modified: 2005-03-15 01:00 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: corey at bbqguys dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.0.2 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: corey at bbqguys dot com
New email:
PHP Version: OS:

 

 [2004-11-08 21:06 UTC] corey at bbqguys dot com
Description:
------------
When I try to access php://input from fopen or fread or file_get_contents or any other way I can think of, the script hangs up until it times out. It almost seems like eof is never being reached, but there is some wierdness to that theory. If I try to dump the contents of php://input to a log file, the log file is written with the contents of php://input, but the next line of code is never reached. However, if I use HTTP_RAW_POST_DATA, the next line of code is reached with blazing speed. I am running  IIS5, win2k, php5.0.2 in CGI mode, gd2, mysql, curl, mcrypt, and PEAR installed.

Reproduce code:
---------------
$data = fopen("php://input", "r");
while (!feof($data)) {
	$result .= fread($data, 4096);
}

OR

$data = file_get_contents("php://input");

Expected result:
----------------
$data winds up containing the contents of php://input and control is returned to the script


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 21:46 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-08-31 15:08 UTC] arturm at union dot com dot pl
Bug still exists (timeout occurs): PHP 5.2.6, Windows XP Pro
Tested on localhost, C# client:
HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Dec 07 21:03:33 2021 UTC