RE: [PHP] Re: CLI script & exec() - how to control what gets dumped on the screen.
| From: | Edward Kay | Date: | Tue, 28 Nov 2006 15:58:23 +0000 |
| Subject: | RE: [PHP] Re: CLI script & exec() - how to control what gets dumped on the screen. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245236@lists.php.net to get a copy of this message | ||
> my fault was indeed thinking along such 'the result' lines - I did
> not consider that stderr was not part of 'the result' and that most
> programs seem to happily spit out their output to stderr (e.g. apache2ctl,
> cvs, mysql to name a few that I was calling in the problem script) and yes
> I'm still rather baffled as to why something like apache2ctl would
> dump the string 'Syntax OK' to stderr - if ever there was some
> user feedback
> that *didn't* represent an error it would be 'Syntax OK'.
>
I agree that this may seem a bit strange at first. My understanding however,
is that stderr is used for errors and diagnostic info; stdout is used for
output to be seen by a user.
The confusion seems to arise from the fact that when using the *nix command
line, stderr and stdout are almost always both set as the terminal window.
I think it would be helpful if the manual page for exec said that on *nix,
it only captures stdout (although this is mentioned in the corresponding
user comments).
Edward