php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12803 Can php close STDOUT
Submitted: 2001-08-17 04:31 UTC Modified: 2001-08-17 04:36 UTC
From: blueeye at mail dot blueeye dot idv dot tw Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: any
Private report: No CVE-ID: None
 [2001-08-17 04:31 UTC] blueeye at mail dot blueeye dot idv dot tw
Would someone tell me how to close STDOUT?

I would like to do some jobs like
<?
   system("/usr/local/bin/php -q jobs.php");
?>
because I don't want it to wait for jobs.php done.

I see system() manual and know to redirect jobs.php's output
should be ok!
I tried system("..... > /dev/null") but fail (reasonable)
but I can't close STDOUT in job.php

if in perl, I can do
# job.php -> job.pl
#!/usr/bin/perl
   close(stdout);

but I don't know how to close/redirect STDOUT in php.
(I've search general maillist for this!)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-17 04:36 UTC] derick@php.net
Nog a bug in PHP. Support questions belong on the php-general@lists.php.net mailing list.
 [2004-07-20 21:23 UTC] riseofthethorax at yahoo dot com
Yeah this would be handly especially if you are trying to 
prevent prints from libraries and sublibraries from fowling up a header when generating say pdf files from a script.. 
To redirect the stdout to /dev/null then when you need it, open the stdout up again and use it to dump the contents of a pdf.. This is what I'm trying to do now and I'm sure its a print statement that is futzing up the stdout. Rather than fix the code for this specific use it would be better just to be able to disable the stdout temporarily..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC