我一直在努力shell_exec PHP函数和在Linux命令2天。 要长话短说,这个工程:在shell_exec和at命令中使用wget?
shell_exec('/usr/bin/at 09:32 <<EOF
touch /var/www/website/hello.txt
EOF'
);
这并不:
shell_exec('/usr/bin/at 09:32 <<EOF
wget -O - -q -t 1 "http://192.168.56.101/website/test.php?param=hello" >/dev/null 2>&1
EOF'
);
为什么?
(注:上面的代码不工作在控制台)提前
感谢。
使用['file_get_contents'(http://php.net/manual/en/function.file-get-contents.php)代替wget的。而cron而不是'at'。 'shell_exec'应该被认为是有害的,并且在一般情况下是最后的手段。 – OmnipotentEntity 2014-08-31 08:27:05
工作是否在'at'结束? (http://serverfault.com/questions/174678/how-do-i-print-contents-of-at-jobs) – GhostGambler 2014-08-31 08:30:55
'system_exec'调用的返回值是什么? – GhostGambler 2014-08-31 08:31:12