&1' to the end of your shell command to have STDERR returned as well as STDOUT. $shell_return = shell_exec($shell_command." ..."/>

webHauser Blog

Icon

Welcome to webHauser weblog

shell_exec() example

$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";

Add ‘2>&1′ to the end of your shell command to have STDERR returned as well as STDOUT.

$shell_return = shell_exec($shell_command." 2>&1");

Leave a Reply

You must be logged in to post a comment.