From: php at the-eend dot org Operating system: Redhat ES3 PHP version: 4.3.10 PHP Bug Type: CGI related Bug description: fclose (STDIN|STDOUT|STDERR) not working
Description: ------------ This is the same bug as reported and fixed for PHP5 last year: http://bugs.php.net/bug.php?id=27865 , but is still present in 4.3.10. Upgrading to PHP 5 is not an option at this point. Any chance this can be back-ported? With CLI scripts, fclosing STDIN, STDOUT and STDERR have no effect, leaving the sockets open, and the terminal which ran the script hanging. Reproduce code: --------------- echo STDIN . '|' . STDOUT . '|' . STDERR . "\n"; fclose (STDIN); fclose (STDOUT); fclose (STDERR); echo STDIN . '|' . STDOUT . '|' . STDERR . "\n"; Expected result: ---------------- The STDIN, STDOUT and STDERR streams should be closed: Resource id #1|Resource id #2|Resource id #3 || (perhaps, though this would mean the value of a 'constant' was being changed...) Actual result: -------------- The streams are not closed, and remain pointing to the same resources: Resource id #1|Resource id #2|Resource id #3 Resource id #1|Resource id #2|Resource id #3 -- Edit bug report at http://bugs.php.net/?id=32107&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32107&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32107&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32107&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32107&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32107&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32107&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32107&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32107&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32107&r=support Expected behavior: http://bugs.php.net/fix.php?id=32107&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32107&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32107&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32107&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32107&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32107&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32107&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32107&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32107&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32107&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32107&r=mysqlcfg