【发布时间】:2015-07-12 17:02:18
【问题描述】:
Executing unix shell commands using PHP Running shell commands using PHP script Execute a shell command through php and display it in browser? 我已经参考了上面的链接。但是,我在浏览器中显示 linux shell 命令过程时遇到了问题。 我的 linux 命令:top -n 1 并想在浏览器中使用 php 显示它们..
myscript.php
<?php
$var = shell_exec('top -n 1');
echo "<pre>$var</pre>";
?>
现在,当我刷新浏览器时,我无法在浏览器中看到输出。
【问题讨论】:
标签: php linux shell browser command