php - linux 作业的命令无法从 php 运行

标签 php linux shell at-job

我有一个带有 的脚本 .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/

相关文章:

linux - 如何从 bash shell 脚本中的数组中删除某个字段?

swift - 在 Swift 中启动终端编辑器,例如 vi 或 nano

shell - 使用Power Shell获取具有页面布局的SharePoint页面列表

php - 在 PHP/MYSQL 中基于 DATE 的 SELECT 的最佳方式

php - 如何以编程方式获取/设置产品价格?

c - unsigned long 到 char 数组

linux - 如何为 Debian 下载/安装预编译的 Subversion 二进制文件

ruby - 在 Linux 上的 Ruby 中,如何检查是否存在像 eth0 这样的命名网络接口(interface)?

php - WampServer v2.5 上线403错误禁止访问

php - 有什么理由不在 PHP 中使用字符串插值吗?