【发布时间】:2012-08-10 15:31:13
【问题描述】:
我已经在 xampp ( ubuntu ) 下执行了这个脚本,它运行良好。但是当我尝试在 Windows 下执行它时,它没有给我任何错误,但也没有输出。
<?
$command='ls -l';
$output = shell_exec($command);
echo $output;
?>
PHP 不在保存模式下运行。问题是什么 ?它取决于操作系统吗?
【问题讨论】:
-
简而言之,是的。有可用于 Windows 的 Bourne Shell 实现(以便您能够运行 bash 脚本)。 unxutils.sourceforge.net
标签: php windows bash xampp wampserver