I have a dozen or so cron jobs running on my Ubuntu 12.04 server, and I use the Webmin interface to administer them. They all execute PHP scripts. Most I created a while back, and they all work fine.
Yesterday, I created a new one, and I tried as much as possible to copy the settings of all my working versions, but this new one won't run. I have it set to run every hour, and every hour I get an email saying only:
Could not open input file: php
I've checked to make sure the PHP script I'm trying to run is executable, and I've set the permissions to be 777. When I run the script directly in a browser, it executes fine.
Even more weird, in the Webmin interface, when I click to "save and run now", it seems to run fine, saying "no output generated", which makes sense, since it just does some operations on my MySQL database.
It only fails when the top of the hour comes around and it's the cron job executing it, not me doing anything manual.
Here is what the settings look like in the Webmin interface:
Here is the output when I click "save and run":
Just for comparison, here are the settings on one of my working scripts:
Why is this new cron job failing? How do I diagnose what is preventing it from working?
Information requested in the comments:
These are the (partial) contents of /var/spool/cron/crontabs/www-data
. The command on the top works great. The command on the bottom is not working.
@hourly php /var/www/xxxxxxxxxxx/xxxxxxxxxxxx_report.php #xxxxxxx error report
@hourly php /var/www/xxxxxxxxxx/htdocs/simuser.php #Script to simulate user actions
which php
this will give you full path and use this path in the crontab entry. – APZ May 20 at 4:06