I spent almost 3 days and cant able to understand and make the Magento Cron to process the scheduled tasks. I am running Magento and recently noticed that order emails are now queued instead of sending instantly. I understand the necessacity but cant able to make the system to pick the queues.

Here is my seeing for Cronjob. enter image description here

Here is my cronjob command line. enter image description here

Here is how the tasks are created in cron_schedule table. enter image description here

Since the records are created in cron_schedule table i think the Cron is running once in every 5 minutes. If I manually delete these records via PhpMyAdmin the records are created automatically after some time.

But the status of the tasks remains 'pending' and never complete. Not sure if something wrong in my configuration or I am missing anything. Can someone please help me how to make the scheduled task run on time. Also why multiple records are created for one job code?


I cleared the entire table and the cron created the scheduled jobs. All the jobs are in pending state and never run even waiting more than 60 minutes. Something is wrong in Magento 1.9.1

Update 11/02: Today I did some more analysis on the process.

I edited the cron.php as below

echo 'iam before mdefault 1';
shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
echo 'iam before malways 1';
shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
echo 'i returned success';

I edited the Mage_Cron_Model_Observer class as below

public function dispatch($observer) {
  echo 'iam inside dispath';

My understanding was when the cron runs the -mdefault it should call the dispatch function and the execute will happen. But what happened was as below in the cron output.

Content-type: text/html

iam before mdefault 1iam before malways 1i returned success

It means the dispatch doesn't called atall...

One another try

I manually changed the variable $isShellDisabled = true; and I changed the below in cron.php.

if ($isShellDisabled) {
  echo 'before always';
  echo 'after always';
  echo 'after default';
} else {

The cron output for the above is as below

Content-type: text/html

before alwaysiam inside dispath alwaysafter always

Now it calls the 'dispatchAlways' but not the 'dispatch'

None of the answers helps me. It never picks the scheduled tasks. I.e when the Cron runs for the first time it successfully created the tasks in the table. But it never executes the task.

  • What happens when you run cron.php from a web browser? It will be a blank page, but I mean what happens to your cron tasks? Commented Feb 9, 2015 at 15:28
  • Try using the bash script: */5 * * * * /bin/sh PATH_TO_PRODUCTION/cron.sh if available. Commented Feb 9, 2015 at 15:57
  • @seanbreeden, when I run via URL on browser it shows a blank page. Nothing has happened to the tasks.. I updated the question with the new set of tasks created... Commented Feb 9, 2015 at 15:58
  • @PhilB, .sh doesn't make any difference. It is similar the pending tasks are pending for ever but I am sure the cron is running for every 5 minutes. Commented Feb 9, 2015 at 17:24
  • did you try to empty the cron_schedule table? Check if it get's filled up with new tasks after an hour or so Commented Feb 10, 2015 at 21:58

6 Answers 6


It was the PHP version of Cron Jobs.

The PHP version was set correctly for the site which is why it was working; however Cron Jobs was running at server native PHP 5.3 which is why I was getting the errors only when running Cron. I updated to version 5.5.

Changed Cron command:

php /home/mydomainname/public_html/cron.php
php55 /home/mydomainname/public_html/cron.php

or in hostgator:

/opt/php55/bin/php /home/mydomainname/public_html/cron.php

in cron.php

$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;

After this line, add:

$isShellDisabled = true;
  • The mention of running cron.php in a specific PHP version (ea-php70 in my case) fixed the issues I was running into: run php -v in terminal to see which PHP version the terminal is using. In my case it was 5.6. So I had to force the usage of PHP 7.0 by changing php to ea-php70 in crontab -e. Thanks! Commented Nov 29, 2017 at 12:49

did you try to empty the cron_schedule table? Check if it get's filled up with new tasks after an hour or so.

Also you can use Aoe_Scheduler to disable specific cronjobs. See if any particular one might cause an error that halts all the other tasks.

The way Magento cronjobs are set up a fatal error in a script will cause the execution of all of the tasks to fail

  • Thanks for the answer. Does the fatal error captured in any log? I updated few more findings on my case and updated the same in my question. Commented Feb 10, 2015 at 22:28
  • @seanbreeden : Today I noticed that when I launch the Cron.php via web browser it works great by picking the schedules. This proves there is no fatal error in any of the script. Any idea why the cron is not running via crontab? Commented Feb 11, 2015 at 21:51

As a first step I would suggest reverting your settings back to Magento's default cron settings:

Magento Cron Defaults

There is an issue with your current settings: your schedule is generated every 15 minutes but only scheduled ahead for 5 minutes which leaves a 10 minute gap.

  • Thanks. Even after I reset to default it doesn't work. When the first time it runs it created all the jobs in cron_schedule table with the scheduled time. The jobs are never picked and stays in the table as pending for ever. One thing I noticed after setting $isShellDisabled = true; and when I launch the Cron.php via browser the jobs are picked but not via CronTab. Commented Feb 14, 2015 at 0:39
  • This problem has not yet solved. Will there be a problem with my hosting provider. I see the script triggered at regular intervals but only the jobs are not picked. Also will it be a problem since I migrated from 1.8? Commented Mar 20, 2015 at 3:20
  • Does your cronjob have enough memory? Try the error logs to see if there is anything in there that could help. Commented Mar 22, 2015 at 21:46
  • this problem is not yet solved... Everyday I am breaking my head. Error logs? where can I see those? Commented May 7, 2015 at 20:50
  • @Malaiselvan for error logs please check with your system admin or webhost as they should know the location and how to access the server's error log. Also it might help to manually run the cron job from the command line - try both php -f cron.php and ./cron.sh to see if they produce anything to investigate further. Commented May 11, 2015 at 3:39

Same problem for me.

"Too late..." error found.

After cleaning cron_schedule table, cron.sh stopped working (not scheduling anymore).

Worked only after killing all old Cron processes.

  • In my case when the Cron runs for the first time it successfully created the tasks in the table. But it never executes the task. :-( Commented May 7, 2015 at 21:10

I had the same problem. My issue was timezone-specific: the created_at and scheduled_at columns in the cron_schedule table should be UTC+0, my entries were UTC+2.

To verify this you can simply set the dates from created_at and scheduled_atto yesterday and wait until the next cron schedule.

Hope that helps someone!


On Bluehost, in cron.sh change

 PHP_BIN=`which php`



By default in the shared hosting it runs PHP 5.2.

I also had to change cron.php, replacing the two $isShellDisabled lines with $isShellDisabled = true;

To get rid of PHP warnings, I also added these lines before


if (empty($_SERVER['SCRIPT_FILENAME'])) $_SERVER['SCRIPT_FILENAME'] = '~/public_html/cron.php';
if (empty($_SERVER['SCRIPT_NAME'])) $_SERVER['SCRIPT_NAME'] = '/cron.php';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.