成功修补 SUPEE-5994 后出现错误:未找到“Mage_Install_Controller_Router_Install”类
-
13-12-2019 - |
题
我成功安装了 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 致命错误:在 /var/www/x/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php 第 138 行中找不到类“Mage_Install_Controller_Router_Install”
我尝试过:
- 清除/var/缓存
- 重置 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');
解决方案
您是否已关闭并清除汇编?
通过控制台/ 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);
.
注意:我有一个类似的问题,其中管理员是空白的,但是,它是覆盖了一个核心文件的模块中的文件 - 但这不是在您的情况下。以防于其他人看待这个问题。
其他提示
如果您禁用了编译器并清除了缓存,但仍然遇到错误
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;
}
}