Magento cron.php Does Nothing After it Runs
I found the solution in the forums (link not online anymore)
Previously I tried to install Magento 1.7.0.2 in my hosting server, and the cron is running fine. So I assumed my hosting cannot run Magento 1.8.0.0 cron so I was planned to downgrade my Magento site to 1.7.0.2. But before I downgrade my site, I found the solution on the link above.
- Edit file cron.php
After
$isShellDisabled = (stripos(PHP_OS, ‘win’) === false) ? $isShellDisabled : true;
around #47 add this line of code$isShellDisabled = true;
And now My Magento 1.8.0.0 cron run perfectly.
The solution given by Wakanina worked for me. However, changing the file cron.php was sort of unacceptable in our policy. Strange thing is that I've deployed my site on two servers(with same OS, PHP version) and on one server it executes cron tasks when cron.php is executed and on other server nothing happens.
So had to try a better solution which will keep my site upgrade proof.
Instead of executing cron.php, I am now executing cron.sh through crontab -e
since Linux is used as server OS.
The issue is magento_root/cron.php
was not set in server crontab
. We need to add this file in crontab so it worked for us as follow.
# crontab -l (this command will list all the Cron jobs in Crontab)
There should be an entry for magento_root/cron.php file. If not, we need to add this file because this file is responsible for initiating your Magento Cron jobs. So we need to edit the Crontab as follow.
# crontab -e
Add the following statement in the file and close after saving it.
*/5 * * * * wget -O /dev/null -q path_to_magento_root/cron.php > /dev/null
For more information, visit this link