Skip to content

Cron jobs do not run on Magento 1.8 after upgrade

After upgrading to Magento 1.8, you may notice that scheduled tasks (cron jobs) stop running. This can affect important functions such as catalog price rules, newsletters, Google Sitemaps, customer alerts, and currency updates. On ruachost.com, this issue is typically caused by changes in how Magento handles cron execution.

  • 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.
  1. Log in to your hosting account via SSH or use cPanel File Manager.

  2. Navigate to your Magento installation directory.

  3. Open the cron.php file in a text editor.

  4. 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;
  5. Immediately after this block, add:

    $isShellDisabled = true;
  6. Save the file and exit the editor.

  • Ensure your hosting account has a cron job configured to run cron.php.

  • Typical cron command:

    Terminal window
    php -q /home/username/public_html/cron.php
  • Set frequency to every 5 minutes for best results.

  • Run the cron job manually:

    Terminal window
    php cron.php
  • Check if catalog rules, newsletters, or alerts are processed.

  • Always back up your site before editing core files.
  • This issue occurs because Magento 1.8 changed how it checks for shell_exec.
  • Adding $isShellDisabled = true; forces cron jobs to run correctly.
  • If problems persist, Contact us for assistance.