Re: ob_start: Capturing STDOUT and STDERR
| From: | Jonesy | Date: | Mon, 24 Mar 2008 01:42:06 +0000 |
| Subject: | Re: ob_start: Capturing STDOUT and STDERR | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-272023@lists.php.net to get a copy of this message | ||
On Sun, 23 Mar 2008 18:08:19 -0700, Greg Sims wrote:
> Hey There,
>
> I looked at the ob_start manual and found a segment of code that can be used
> to capture the output of a shell script and place it into a log file. One
> of the entries indicates this should work for both STDOUT and STDERR
> (29-Mar-2007). I wrote the following piece of code to test it out.
>
> function logger($buffer)
> {
> $handle = fopen('/var/log/test.log', 'a');
> fwrite($handle, $buffer);
> fclose($handle);
> }
>
> ob_start("logger");
ob_start("logger 2>&1");
???
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>