Magento 1.9 cron作业和PHP 7
我已经用PHP7安装了Magento 1.9.2.2,并且我正在使用一个用于shell执行的cron作业来导入产品并将订单导出给我的供应商。不幸的是,没有启动任何流程,我正试图找出问题所在 cron作业设置为/usr/local/bin/php/home/“username”/domains/“mydomain”/public\u html/cron.sh,并给出以下响应:Magento 1.9 cron作业和PHP 7,cron,magento-1.9,php-7,Cron,Magento 1.9,Php 7,我已经用PHP7安装了Magento 1.9.2.2,并且我正在使用一个用于shell执行的cron作业来导入产品并将订单导出给我的供应商。不幸的是,没有启动任何流程,我正试图找出问题所在 cron作业设置为/usr/local/bin/php/home/“username”/domains/“mydomain”/public\u html/cron.sh,并给出以下响应: # # Magento # # NOTICE OF LICENSE # # This sou
#
# 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
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
但是如果我使用/usr/local/bin/php/home/“username”/domains/“mydomain”/public\u html/cron.php,它会给出以下响应:
#
# 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
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)是否正常工作,但是否由于PHP7而存在冲突?如何更正此问题?必须解决
DivisionByZeroError
异常
在PHP7之前,被零除会引发一个警告,您可以随意忽略该警告,并允许在当前代码路径中继续执行。必须解决
DivisionByZeroError
异常
在PHP7之前,被零除会引发警告,您可以随意忽略该警告,并允许在当前代码路径中继续执行