|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-18 19:01 UTC] php at nineberry dot de
Description:
------------
Posting to a php script makes the script hang reading from php://input on a server with IIS 6.0 / CGI
Code works fine on Apache both on Linux and Win32.
Code also works as expected, when "text/plain" is used as enctype in the HTML Form.
Maybe related to #38488 ?
Maybe stdin is not opened as binary any longer?
Reproduce code:
---------------
HTML Form:
<html>
<body>
<form method="POST" action="1.php">
<input type="hidden" name="test" value="yyyy">
<input type="submit">
</form>
</body>
</html>
PHP Code in 1.php:
<?php
// Read 1 char
$f = fopen('php://input', 'rb');
$inpData = fread($f, 1);
fclose ($f);
echo($inpData);
echo("Done");
?>
Expected result:
----------------
Expected Output:
tDone
Actual result:
--------------
Constantly loading, CGI timeout after some minutes.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 03:00:01 2025 UTC |
OK, my test is similar (hangs on submit): <?php if($_SERVER["REQUEST_METHOD"] == "POST") { header("Content-type: text/xml"); $s = file_get_contents("php://input"); echo <<<EOT <xml/> EOT; } else { echo <<<EOT <form method="post" action=""> <input type="text" value="abc"> <input type="submit" name="s1" value="Submit"> </form> EOT; } ?> Bug occured on: 1. Windows XP, PHP 5.2.10, IIS 5.1, CGI 2. Windows 2003, PHP 5.2.6, IIS 5.1, CGI Didn't occured on: Windows 2008, PHP 5.2.5 (x64), IIS 6, ISAPI