shell_exec()
:
I'm doing a PHP site that uses a shell_exec()
function like this:
$file = "upload/" . $_FILES["file"]["name"];
$output = shell_exec("leaf $file");
echo "<pre>$output</pre>";
Where leaf is a program that is located in the same directory of my script, but when I tried to run this script on the server, I just got nothing.
exec()
:
If I try by using exec()
like this:
exec("sh " . getcwd() . "leaf -h", &$output);
echo "<pre>";
print_r(&$output);
echo "</pre>";
I got this:
Array ( )
If I do the same thing, but using echo
instead of print_r
, I got only this: Array
What I can do?