ID: 48419 Updated by: j...@php.net Reported By: juro at shaw dot ca -Status: Open +Status: Feedback Bug Type: CGI related Operating System: Windows XP PHP Version: 5.2.10RC1 New Comment:
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2009-05-28 20:36:32] juro at shaw dot ca Description: ------------ Using a generic web server with a simple CGI support (running on Windows XP), I fail to obtain any $_POST data. However, raw post data are OK. Raw post data is sent to the PHP-CGI.exe via redirected pipe handle. PHP-CGI reads correctly posted raw data using stdin. I suspect the culprit may be with the following PHP source code: File:cgi_main.c Routine:static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) ... tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); ... Low level i/o functions read,write,open are not 100% portable. The code is most like meant to read stdin. Assuming that file descriptor for stdin is numerically equal to 0 on all platforms is wrong. The code should be probably something like this tmp_read_bytes = read(_fileno(stdin), buffer + read_bytes, count_bytes - read_bytes); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48419&edit=1