ID: 44217 Updated by: j...@php.net Reported By: exe at travian dot org -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: * PHP Version: 5.*, 6CVS (2009-01-21) New Comment:
See bug #48803, using ignore_user_abort=1 "fixes" this for you. Previous Comments: ------------------------------------------------------------------------ [2008-06-28 19:35:29] work at anomalizer dot net I guess what you are asking for is something like this to happen when you close STDOUT dup2(open("/dev/null", O_WRONLY), 1); ------------------------------------------------------------------------ [2008-04-27 13:40:51] duane at e164 dot org The solution to stopping this output is rather simple. After you close the stdin/stdout/stderr open 3 new file descriptors to /dev/null and all output goes bye bye. eg. fclose(STDIN); fclose(STDOUT); fclose(STDERR); $fp1 = fopen('/dev/null', 'r'); $fp2 = fopen('/dev/null', 'w'); $fp3 = fopen('/dev/null', 'w'); ------------------------------------------------------------------------ [2008-02-25 11:54:22] exe at travian dot org I'd expect php to discard every output after STDOUT is closed, instead of doing a silent exit (which is hard to track because no error handler or shutdown function is called). Another option (if output in this situation is considered to be an error) would be to trigger a warning/fatal and/or call the shutdown function. This would, at least, make it possible to track this issue. I have to close STDOUT and STDERR in a daemonized processes to detach from the controlling terminal. ------------------------------------------------------------------------ [2008-02-24 00:40:01] j...@php.net Another bug #44218 describes some more expected behaviour caused by closing the input/output streams. NOTE: Correct manual page: http://www.php.net/manual/en/wrappers.php.php ------------------------------------------------------------------------ [2008-02-24 00:34:08] j...@php.net That's quite expected since you're still trying to output to STDOUT. Why do you want to close STDOUT anyway? See also: http://www.php.net/wrappers.php ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44217 -- Edit this bug report at http://bugs.php.net/?id=44217&edit=1