0
私はバックエンドのPythonスクリプトを呼び出すためにPHPスクリプトを使用しています。php shell_exec no permission
<?php
error_reporting(-1);
$output = shell_exec("sh run.sh 2>&1");
echo "<pre>$output</pre>";
?>
run.shスクリプトは次のとおりです。
#!/bin/bash
wget http://markets.usatoday.com/custom/usatoday-com/html-mktscreener.asp
python hw7-9.py index.html
echo "done";
出力は
run.sh: wget: not found
run.sh: python: not found
done
私はシェルから、通常はそれを実行した場合、それは完璧に動作しています。見つからなかった私は、「wgetのどの」と私は許可を得
/afs/cad/sw.common/bin/wget -O index.html http://markets.usatoday.com/custom/usatoday-com/html-mktscreener.asp
完全なパスを交換しました試してみて、修正する はあなたのPHPとシェルスクリプトのパーミッションは何ですか?
あなたのWebサーバーがそのフォルダへの書き込み権限を持っていることを確認してください。 – zneak
出力ファイルへのフルパスも定義します... –