![](/img/trans.png)
[英]PHP cannot find my shell script to execute it with shell_exec()
[英]exec cannot find the PHP file to execute
我正在尝试使用shell_exec
命令从另一个PHP脚本调用一个PHP脚本。 当我使用相同的用户在shell中输入相同的命令时,一切都会按预期进行。 但是,当我在PHP中调用它时,得到以下输出:
X-Powered-By: PHP/5.3.23
Content-type: text/html
我的PHP调用是:
shell_exec('php -f /home/site/public_html/script.php > /home/site/log.txt &');
我检查服务器配置。 安全模式已关闭。 shell_exec('whoami')
正常工作。
尝试
shell_exec('/usr/bin/php -f /home/site/public_html/script.php > /home/site/log.txt &');
或输入
whereis php
并使用给定的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.