I'm not sure how can I debug this, I set the crontab and walked away earlier and came back with no results. Just now, I ended up using this thread: Using CronTab to run php scripts and have it set to run every minute. My PHP script isn't running. I tried wget
and php
. It works when I visit it in the browser, but not when crontab is running it.
Update:
May 16 10:39:01 strawberry /USR/SBIN/CRON[12283]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm)
So it fired off but I'm still not getting expected results. However, it works when I go to the website url. I'm using this in my crobtab: https://stackoverflow.com/a/5134125/170365
* * * * * wget http://mysite.com/myscript >/dev/null 2>&1
I also tried running it as www-data
and root
: How to set a crontab using php?