2015-12-31 107 views
0

我已經在PHP 7上安裝了Magento 1.9.2.2,並且我正在使用cron作業執行shell以導入產品並將訂單導出到我的供應商。不幸的是沒有進程開始,我想弄清楚是什麼問題。Magento 1.9 cron作業和PHP 7

cron作業設置爲在/ usr/local/bin目錄/ PHP /home/"username"/domains/"mydomain"/public_html/cron.sh並給出以下respons:

# 
    # Magento 
    # 
    # NOTICE OF LICENSE 
    # 
    # This source file is subject to the Open Software License (OSL 3.0) # that is bundled with this package in the file LICENSE.txt. 
    # It is also available through the world-wide-web at this URL: 
    # x 
    # If you did not receive a copy of the license and are unable to # obtain it through the world-wide-web, please send an email # to x so we can send you a copy immediately. 
    # 
    # DISCLAIMER 
    # 
    # Do not edit or add to this file if you wish to upgrade Magento to newer # versions in the future. If you wish to customize Magento for your # needs please refer to x for more information. 
    # 
    # @category Mage 
    # @package  Mage 
    # @copyright Copyright (c) 2006-2015 X.commerce, Inc. (x) 
    # @license x Open Software License (OSL 3.0) 
    # 

    # location of the php binary 
if [ ! "$1" = "" ] ; then 
    CRONSCRIPT=$1 
else 
    CRONSCRIPT=cron.php 
fi 

MODE="" 
if [ ! "$2" = "" ] ; then 
    MODE=" $2" 
fi 

PHP_BIN=`which php` 

    # absolute path to magento installation 
INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'` 

    # prepend the intallation path if not given an absolute path 
if [ "$INSTALLDIR" != "" -a "`expr index $CRONSCRIPT /`" != "1" ];then 
    if ! ps auxwww | grep "$INSTALLDIR$CRONSCRIPT$MODE" | grep -v grep 1>/dev/null 2>/dev/null ; then 
     $PHP_BIN $INSTALLDIR$CRONSCRIPT$MODE & 
    fi 
else 
    if ! ps auxwww | grep "$CRONSCRIPT$MODE" | grep -v grep | grep -v cron.sh 1>/dev/null 2>/dev/null ; then 
     $PHP_BIN $CRONSCRIPT$MODE & 
    fi 
fi 

但如果我使用/ usr/local/bin目錄/ PHP /home/"username"/domains/"mydomain"/public_html/cron.php它提供了以下respons:

PHP Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Schedule.php:165 
Stack trace: 
    #0 /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Schedule.php(95): Mage_Cron_Model_Schedule->matchCronExpression('*', 10) 
    #1 /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Observer.php(193): Mage_Cron_Model_Schedule->trySchedule(1451563804) 
    #2 /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Observer.php(138): Mage_Cron_Model_Observer->_generateJobs(Object(Mage_Core_Model_Config_Element), Array) 
    #3 /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Observer.php(75): Mage_Cron_Model_Observer->generate() 
     #4 /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Core/Model/App.php(1357): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer)) 
     #5 /home/"username"/domai in /home/"username"/domains/"mydomain"/public_html/app/code/core/Mage/Cron/Model/Schedule.php on line 165 

是cron作業(cron.sh )正常工作,但是由於PHP 7有衝突嗎?我能做些什麼來糾正這個問題?

回答

3

DivisionByZeroError異常必須解決。

在PHP 7之前,除以零會產生一個警告,您可以自由忽略並允許執行在當前代碼路徑中繼續。