Cron jobs do not run on Magento 1.8 after upgrade

This article describes how to resolve a problem that may occur after you upgrade a Magento installation to version 1.8.

Problem

After you upgrade a Magento installation to version 1.8, cron jobs do not appear to run. For example, you may notice that the following occurs:

  • Catalog price rules are not updated.
  • Newsletters are not sent.
  • Google Sitemaps are not generated.
  • Customer alerts are not sent.
  • Currency rates are not updated.

Resolution

To work around this problem, follow these steps:

  1. Open the Magento cron.php file in a text editor. You can do this by logging in to your account using SSH, or if your account includes cPanel, from the cPanel File Manager.
  2. Locate the following code block around line 45:
    $disabledFuncs = explode(',', ini_get('disable_functions'));
    $isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
    $isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
  3. Copy the following line of code and paste it after the code block you located in step 2:

    $isShellDisabled = true;
  4. Save the changes to the cron.php file and exit the text editor. The cron job should now run correctly.

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.