wget cron job不起作用,但是当手动刷新脚本时,它可以工作

问题描述:

My wget cron job looks like this (set to every minute for testing):

* * * * * wget -q -O - web-url.com/sub-folder/cron_job.php?us=user&pa=user2

It sends me email with html from php every minute as notification that cron is done, but php should send email to user and echo id of that user for testing. Now when cron job does it php is not executed (mail not sent and there is no id in mail that i get in cron sent info) But when i go to that page then everything works, user gets mail and I see his id. Why is this happening?

我的wget cron作业看起来像这样(设置为每分钟进行测试): p>

  * * * * * wget -q -O  -  web-url.com/sub-folder/cron_job.php?us=user&pa=user2

它每分钟发送一封来自php的html电子邮件作为cron完成的通知,但是php应该向用户发送电子邮件并回复该用户的id进行测试。 现在,当cron工作时,php没有被执行(邮件没有被发送,并且我在cron发送信息的邮件中没有id) 但是当我去那个页面然后一切正常,用户收到邮件,我看到他的身份。 为什么会发生这种情况? p> div>

You have to place quotes around the url. :) Otherwise it's probably not doing the get parameters.