php运行shell脚本

Kam*_*224 7 php bash

我正在尝试从php前端运行shell脚本

下面是shell文件(run.sh chmod到777)

#!/bin/bash
wget -O index.html http://markets.usatoday.com/custom/usatoday-com/html-mktscreener.asp
python hw7-9.py index.html 
echo "done";
Run Code Online (Sandbox Code Playgroud)

继承了php前端

<?php
   $output = shell_exec("run.sh");
   echo "<pre>$output</pre>";
?>
Run Code Online (Sandbox Code Playgroud)

但它的php页面除了返回任何内容

<pre></pre>
Run Code Online (Sandbox Code Playgroud)

Mik*_*ike 1

您是否尝试过error_reporting(-1);在 PHP 脚本的顶部执行此操作?可能shell_exec在您的服务器上被禁用。