I recently upgraded a client’s Magento environment from 188.8.131.52 to 184.108.40.206 and I ran into some issues with the cron process. After reading a few posts with other people having similar issues, here, here, here, I decided to implement AOE Scheduler (also available on GitHub, here) as this plugin gives me more visibility to what jobs are being processed, and additionally more flexibility, and control of the cron process. I was also hoping that my cron issues would be solved with this plugin! After installation, I followed the instructions for adding the AOE jobs to cron, but I still couldn’t get anything to work. After some quick debugging, I discovered that the jobs would run from the command line, but not from cron. The jobs I created are as per instructions below:
The error messages being generated from cron immediately lead me to the cause and its location. The problem was on line 3 of \shell\scheduler.php:
require_once dirname($_SERVER[‘SCRIPT_NAME’]) . DIRECTORY_SEPARATOR . ‘abstract.php’;
The fix that worked for me was:
require_once(dirname(__FILE__). DIRECTORY_SEPARATOR . “abstract.php”);
I hope this might help someone else!