我有一个非常简单的 PHP 脚本来尝试使用 exec 命令。代码是
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo("test<br>");
echo exec('whoami');
echo("test");
?>
但是,当我访问该页面时,它只会打印出来:
test
test
它不打印“whoami”命令的输出,从命令行运行时会显示
me
这里有什么问题?我无法解决。
非常感谢!