为什么Shell_exec()和exec()在php中不起作用? $ return_val为0

时间:2019-01-12 11:43:05

标签: php terminal cron exec shell-exec

file_put_contents('/opt/lampp/htdocs/imslivedec/crontab.txt','0 11 15 1 * /opt/lampp/htdocs/imslivedec/sendmail.php'.PHP_EOL,FILE_APPEND);
shell_exec('crontab /opt/lampp/htdocs/imslivedec/crontab.txt');

当我在终端中运行此完全相同的命令时,新的cron作业正在 创建的,但是当我使用shell_exec()从php脚本执行操作时,该命令未在终端中执行。请问为什么我在这里做错了什么?当我尝试创建新文件夹时,shell_ exec可以正常工作。

0 个答案:

没有答案
相关问题