Here is my situation:
I am trying to run a php script via cron and I have crontab (/ etc / crontab) which looks like this:
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/var/www: MAILTO=<myemailaddress> mh dom mon dow user command * * * * * root /usr/bin/php /var/www/testing.php
And when I run the command /usr/bin/php /var/www/testing.php from bash / sh, everything is dandy. This is just a basic PHP script that writes some gibberish to a file. However, my cronjob is not running. I used sudo service cron several times, but all to no avail. Did I miss something obvious here?
Thank you and welcome!
Decision
My own mistake! The executable php script that I ran wrote to a file that was not processed correctly - for example, the full path to the file was missing. Thanks for helping everyone!
source share