From: mflanagan at MJFlanagan dot com Operating system: Windows 2000 PHP version: 4.3.3 PHP Bug Type: Output Control Bug description: Output seems to be ignored
Description: ------------ I have a server page that should be seinding output to a client php command-line script (not a browser). The headers arrive at the client, but the resot of the output doesn't. The same scripts work correctly under RH Linux (7.something) and Apache, same version of PHP. Reproduce code: --------------- LH_Svc.php: <?php $resp = "<response>\r\n"; $respLen = strlen ($resp); header ("Content-Type: text/xml"); header ("Content-Length: $respLen\n"); echo ($resp); // send back to caller exit; ?> Client: <?php $server = "localhost"; $url = "/earn/LH_Svc.php"; $port = 80; // open socket $fp = fsockopen($server, $port); if (!$fp) { echo "Could not open socket"; } else { $postData = "<test>"; $dataLen = strlen ($postData); $postHeader = "POST $url HTTP/1.0\r\n"; $postHeader .= "User-Agent: PHP-MJF Client\r\n"; $postHeader .= "Content-Type: text/xml\r\n"; $postHeader .= "Content-Length: $dataLen\n"; $postHeader .= "\r\n"; // required extra blank line echo ($postHeader); echo ($postData); echo ("\n====================\n"); fwrite ($fp, $postHeader); fwrite ($fp, $postData); $getResponse = fread ($fp, 14096); fclose ($fp); echo "Length of response is " . strlen ($getResponse) . "\r\n"; echo $getResponse; echo "=====================\n"; } ?> Expected result: ---------------- D:\EarnApps>d:\php\php-4.3.3-win32\cli\php.exe post.cli POST /earn/LH.php HTTP/1.0 User-Agent: PHP-MJF Client Content-Type: text/xml Content-Length: 6 <test> ==================== HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 04 Nov 2003 18:30:44 GMT X-Powered-By: PHP/4.3.3 Content-Type: text/xml Content-Length: 10 <response> ===================== Actual result: -------------- D:\EarnApps>d:\php\php-4.3.3-win32\cli\php.exe post.cli POST /earn/LH.php HTTP/1.0 User-Agent: PHP-MJF Client Content-Type: text/xml Content-Length: 6 <test> ==================== HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 04 Nov 2003 18:30:44 GMT X-Powered-By: PHP/4.3.3 Content-Type: text/xml Content-Length: 10 ===================== -- Edit bug report at http://bugs.php.net/?id=26451&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26451&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26451&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26451&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26451&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26451&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26451&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26451&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26451&r=support Expected behavior: http://bugs.php.net/fix.php?id=26451&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26451&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26451&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26451&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26451&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26451&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26451&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26451&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26451&r=float