note 13202 deleted from function.popen by didou
| From: | didou@php.net | Date: | Tue, 03 Feb 2004 09:54:33 +0000 |
| Subject: | note 13202 deleted from function.popen by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64592@lists.php.net to get a copy of this message | ||
Note Submitter: floyd@studiodust.com
----
I discovered that if I popen a C program that forks and execs a daemon, or any program that does not
exit, file descriptors that remain open will keep the WEB server from closing the connection or keep
it from pening a new connection. I'm not exactly sure what the underlying problem is, but
after the popen'ed program exited my browser reported that the document was complete but I got
no repsonse when I attmepted to return to the PHP script that spawned the process.
The forked process was closing file descriptors 0, 1 and 2, as I had to
do when spawing this process form a CGI perl script. But I determined that when spawned from a PHP
script there were 2 or 3 additional file descriptors open and I had to close those as well. I
determined how many file descriptors to close in the forked process by savig the file descriptor
value of the first file my program opened.
I am running PHP 4.0.5 with Apache 1.3.19 under Linux 2.2.10.