shell_exec()
:
我正在做一个使用这样的shell_exec()
函数的 PHP 站点:
$file = "upload/" . $_FILES["file"]["name"];
$output = shell_exec("leaf $file");
echo "<pre>$output</pre>";
其中叶子是位于我的脚本同一目录中的程序,但是当我尝试在服务器上运行此脚本时,我什么也没得到。
exec()
:
如果我尝试exec()
这样使用:
exec("sh " . getcwd() . "leaf -h", &$output);
echo "<pre>";
print_r(&$output);
echo "</pre>";
我懂了:
大批 ( )
如果我做同样的事情,但使用echo
而不是print_r
,我只得到这个:Array
我可以做什么?