ID: 47825 Updated by: [email protected] Reported By: tiposchi at tiscali dot it -Status: Open +Status: Bogus Bug Type: CGI related Operating System: GNU/Linux PHP Version: 5.2.9 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2009-03-29 09:32:38] tiposchi at tiscali dot it Description: ------------ CGI protocol says that POST data must be passed to the script using its standard input. So what i have to do is something like (see the attached code). Anyway, the php knows how long the input will be because it has an environmental variable called content length that says it. So php should wait to read the entire post data before going on. Since i don't have any information about how the scheduler works, i can't assure the father process to fill the pipe before the child is scheduled. But php ignores the data if the pipe isn't full already. So what i did was filling the pipe BEFORE the fork, and doing this it works. But there is another problem. With large POST data, the buffer is filled and the OS puts my process on wait until the pipe is empty by another process. But i didn't start the php yet because it wants all the post data already present, so the webserver just hangs. I think you should review the way php-cgi reads post data. Thanks Reproduce code: --------------- p=pipe() if (fork()==0) { close(STDIN) dup(p) exec ("php") } else { write(p,str_post) wait() } I HAVE MADE THE CODE SIMPLE. I KNOW THIS CAN'T WORK. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47825&edit=1
