CRON jobs keep erroring
We have several CRON jobs running on our apache / whm server. We are using php. The scripts all work completely fine when run from the browser.
The cron will throw back errors like: unable to include files (even when giving the absolute path).
Results will also vary, corrupting output files etc. I am really baffled, as sometimes the crons work fine as well. Seems really intermittent and they work every time perfectly when executed from the browser.
Any help would be appreciated, che开发者_高级运维ers.
As everyone has pointed out, PHP CLI and the PHP Apache Module are separate software and they have separate configuration files.
Rather than set the crontab up on the root cron tab, make sure all your permissions are correct. Debug with the user they will run from cron as. Assuming you are running Linux, you can use
sudo -i -u username
for this.
精彩评论