Search code examples
scheduled-tasksmagento-1.9cron-task

Magento Cronjob error also Heartbeat not found


when i run the Tasks :

* * * * * /bin/bash /home/soulexhi/public_html/scheduler_cron.sh --mode always
* * * * * /bin/bash /home/soulexhi/public_html/scheduler_cron.sh --mode default

As per Cron Scheduler tells me to i am getting this error message via Email HELP!!

Content-type: text/html; 

<br />
<b>Warning</b>:  require_once(/abstract.php): failed to open stream: No such file or directory in <b>/home/soulexhi/public_html/shell/scheduler.php</b> on line <b>3</b><br /> <br /> <b>Fatal error</b>:  require_once(): Failed opening required '/abstract.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/soulexhi/public_html/shell/scheduler.php</b> on line <b>3</b><br />

At the beginning of the file 'magento_root/shell/scheduler.php' there is a require_once that I changed to the following to:

if (!empty($_SERVER['SCRIPT_NAME']))
        require_once dirname($_SERVER['SCRIPT_NAME']) . DIRECTORY_SEPARATOR . 'abstract.php';
else
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'abstract.php';

but it did not work. Does anyone have any idea?


Solution

  • Solved: 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
    to
    php55 /home/mydomainname/public_html/cron.php
    

    in cron.php

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

    After this line, add:

    $isShellDisabled = true;