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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC