|
Posted by ZeldorBlat on 10/28/07 20:29
On Oct 28, 3:27 pm, "ryanm...@yahoo.com" <ryanm...@yahoo.com> wrote:
> I am running PHP 5.1.6 (cli) on Linux. When i use the exec($cmd,
> $output, $return) command the $output array is always blank if the
> command had an error in it. There are only values if the command was
> successful. How do I capture the error text returned?
There's a comment in the manual on exec() that explains this. Since
you couldn't find it (or didn't look) I'll paste it here.
$command = 'your command goes here';
$output = exec($command . ' 2>&1', $output, $return);
Navigation:
[Reply to this message]
|