Catch STDERR
- From: lists@xxxxxxxxxxx ("Peter Lauri")
- Date: Sat, 17 Feb 2007 22:49:34 +0200
Hi,
I am executing exec('some cool command', $stdout, $exitcode);
That is fine. I get what I in the beginning wanted. However, now I need to
catch the STDERR that the command is generating as well. Some of you might
tell me to redirect STDERR to STDOUT, but that is not possible as I need to
use the STDOUT as is to automate a process.
I know I can do fwrite(STDERR, 'Output some error\n');
So could I fread(STDERR, SOMESIZE)?
Is there anyone with experience of best way of doing this? Should I maybe
use proc_open or something similar and then write it to a file, and then
read that file? Hrm, doesn?t make any sense to do that.
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free
.
- Follow-Ups:
- Re: [PHP] Catch STDERR
- From: "Richard Lynch"
- Re: [PHP] Catch STDERR
- From: Frank Arensmeier
- Re: Catch STDERR
- From: petersprc
- Re: [PHP] Catch STDERR
- Prev by Date: Re[2]: [PHP] counting hyperlink clicks in php
- Next by Date: RE: [PHP] LOL, preg_match still not working.
- Previous by thread: LOL, preg_match still not working.
- Next by thread: Re: Catch STDERR
- Index(es):
Relevant Pages
|