I want to build a php based site that (automate) some commands on my Ubuntu Server
first thing I did was going to the file (sudoers) and add the user www-data so I c
From the PHP manual on exec:
Return Values
The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function. To get the output of the executed command, be sure to set and use the output parameter.
So you have to do something similar to this:
'.$command."
";
exec($command, &$output);
echo implode("
\n", $output);
?>