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.

 

Symptoms

  • 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 Steps

Step 1: Edit cron.php

  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.

 

Step 2: Verify Cron Job Setup

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

  • Typical cron command:

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

 

Step 3: Test Cron Execution

  • Run the cron job manually:

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

 

Important Notes

  • 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.

Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)

Powered by WHMCompleteSolution