我有一个带有 curl 的脚本 .sh
命令在里面:
curl --digest "http://xxxxxxx.xxx/mail.php?email=xxxx@xxx.xx";
从终端这很好用:
./script.sh #(mail arrives in my box)
在 php 中这很好用:
shell_exec('./phpsc.sh'); // (mail arrives in my box)
从终端这很好用:
at -f phpsc.sh now + 5 minute
# (job created, mail arrives in my box after 5 minutes)
在 php 中这是行不通的:
shell_exec('at -f phpsc.sh now + 5 minute'); //:( :(
即使我将 at
命令放入脚本并从 php 运行脚本 at
命令,它也会被忽略 :(
最佳答案
我找到了解决方案,
我从 /etc/at.deny 中删除了 www-data,现在 'at' 命令在 php (sell_exec) 中工作正常
关于php - linux 作业的命令无法从 php 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37716686/