成功修补SUPEE-5994之后发生错误:找不到类'Mage_Install_Controller_Router_Install'


36

我成功安装了SUPEE-5994补丁:

[root@x]# sh PATCH_SUPEE-5994_EE_1.14.1.0_v1-2015-05-14-05-05-02.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.

但是现在,我所有的网页都是空白。

httpd错误日志:

[错误] [客户端x] PHP致命错误:在第138行的/var/www/x/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php中找不到类'Mage_Install_Controller_Router_Install'

我试图:

  • 清除/ var / cache
  • 重置chmod / chown
  • 重新启动httpd服务

但是似乎没有任何作用。

有人有同样的问题吗?

编辑:Front.php文件:

 Varien_Profiler::start('mage::app::init_front_controller::collect_routers');
    foreach ($routersInfo as $routerCode => $routerInfo) {
        if (isset($routerInfo['disabled']) && $routerInfo['disabled']) {
            continue;
        }
        if (isset($routerInfo['class'])) {
   // LINE 138 HERE
            $router = new $routerInfo['class'];
            if (isset($routerInfo['area'])) {
                $router->collectRoutes($routerInfo['area'], $routerCode);
            }
            $this->addRouter($routerCode, $router);
        }
    }
    Varien_Profiler::stop('mage::app::init_front_controller::collect_routers');

Answers:


38

您是否关闭并清除了编译?

通过控制台/ ssh,您可以使用

$ php -f shell/compiler.php -- disable

$ php -f shell/compiler.php -- clear

$ php -f shell/compiler.php -- compile

$ php -f shell/compiler.php -- enable

可能需要第四行...不确定。

您显示的代码之前的行可能有问题

$routersInfo = Mage::app()->getStore()->getConfig(self::XML_STORE_ROUTERS_PATH);

注意:我有一个类似的问题,其中管理员为空,但是事实证明这是模块中的文件,该文件覆盖了一个核心文件-但这不是您的情况。以防万一其他人对此问题有所关注。


哇,你就是那个家伙!非常感谢。只需编辑第三行,它就是php -f shell / compiler.php -为我编译。有用 !
Cqke

1
凉。上周更新网站时遇到了麻烦,真是太好了:)很高兴为您提供帮助
乔恩·霍兰德

1
更新了好地方。
乔恩·荷兰

乔恩(Jon)
大卫·威尔金斯

:)你知道的,大卫。很高兴看到人们摆脱了泡菜。
乔恩·霍兰德

14

如果禁用了编译器并清除了缓存,仍然会遇到错误

Class 'Mage_Install_Controller_Router_Install' not found

检查文件是否app/code/core/Mage/Install/Controller/Router/Install.php存在。

运行补丁程序时,该目录Router不存在app/code/core/Mage/Install/Controller,因此Install.php尽管applied.patches.list文件中另有说明,但该文件未创建。这意味着您缺少课程,您会收到以下消息:

Fatal error: Class 'Mage_Install_Controller_Router_Install' not found

摘录自applied.patches.list所谓的成功补丁安装,但未能创建Install.php文件:

patching file app/code/core/Mage/Install/Controller/Router/Install.php
patching file app/code/core/Mage/Install/etc/config.xml

该修补程序会在app/code/core/Mage/Install/etc/config.xml引用丢失文件的文件中添加以下内容:

 <default>
     <web>
         <routers>
             <install>
                 <area>frontend</area>
                 <class>Mage_Install_Controller_Router_Install</class>
             </install>
         </routers>
     </web>
 </default>
 <stores>
     <default>
         <web>
             <routers>
                 <install>
                     <area>frontend</area>
                     <class>Mage_Install_Controller_Router_Install</class>
                 </install>
             </routers>
         </web>
     </default>
 </stores>

丢失的文件app/code/core/Mage/Install/Controller/Router/Install.php应该包含的样本。

<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * 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 license@magento.com 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 http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Install
 * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */

class Mage_Install_Controller_Router_Install extends Mage_Core_Controller_Varien_Router_Standard
{
    /**
     * Check if current controller instance is allowed in current router.
     * 
     * @param Mage_Core_Controller_Varien_Action $controllerInstance
     * @return boolean
     */
    protected function _validateControllerInstance($controllerInstance)
    {
        return $controllerInstance instanceof Mage_Install_Controller_Action;
    }
}

1
除了Fiasco Labs之外,我还听说过有人遇到这种麻烦。
乔恩·霍兰德

1
准确描述本案中发生的情况,以上内容解决了该问题。谢谢
Flipmedia 2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.