【问题标题】:Error including Mage_Install_Controller_Router_Install.php in Magento?Magento 中包含 Mage_Install_Controller_Router_Install.php 的错误?
【发布时间】:2015-08-02 16:50:16
【问题描述】:

我正在运行一个 Magento 商店,当我尝试在浏览器中打开它时它显示一个白屏。我检查了日志,其中的消息是:

警告:包含(Mage_Install_Controller_Router_Install.php)[function.include]:无法打开流: 在......中没有该文件或目录 /html/magento/includes/src/Varien_Autoload.php 在第 93 行

警告:include() [function.include]: 打开“Mage_Install_Controller_Router_Install.php”失败 包容 (include_path='/html/magento/includes/src:.:/usr/local/php/lib/php:/usr/local/php/lib/php/PEAR') 在 /html/magento/includes/src/Varien_Autoload.php 第 93 行

我更改了 index.php 以显示错误,显示的错误是:

致命错误:找不到类“Mage_Install_Controller_Router_Install” 在 /html/magento/includes/src/__default.php 第 16045 行

所以我去了 app/code/core/Mage/Install/Controller/Router 看看 Install.php 是否存在并且确实存在。那为什么找不到呢?

谢谢!

【问题讨论】:

  • 这是编译器问题的结果,或者是错误的 XML 导致模块加载问题,或者核心配置文件错误。如果在添加模块后发生这种情况,请移除该模块并查看其配置。如果这种情况是自发发生的,请检查是不是更新造成了破坏,然后检查核心系统和路径的配置

标签: magento


【解决方案1】:

我在应用安全补丁后遇到了同样的错误,但由于我的商店已经在运行,我不需要安装模块路由器,所以我打开了 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> -->

【讨论】:

  • 这解决了我的致命错误(在手动清除所有会话和缓存并禁用 opcache 之后)但是补丁添加了该路由器以关闭安全漏洞。这基本上取消了您的 Magento 安装补丁。我想知道为什么文件一开始就没有自动加载。
【解决方案2】:

我认为,你需要重新编译:

在您的 Magento 根文件夹中:

$ php shell/compiler.php disable
$ php shell/compiler.php clear
$ php shell/compiler.php compile
$ php shell/compiler.php enable

【讨论】:

  • 这太完美了!谢谢!
【解决方案3】:

按照@Royw 的建议重新运行编译器脚本(也在后端菜单“系统”>“工具”>“编译器”中),甚至更好地完全停用,因为它完全没用,而且提供的问题多于解决方案。

【讨论】:

    【解决方案4】:
    if you get these errors, there is another way to disable the compiler. Find the file config.php in the directory includes. It will look like this:
    <?php ...
    define('COMPILER_INCLUDE_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
    define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
    comment out both lines like this:
    #define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
    #define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
    try again. You will probably be able to login now. Go to your tools, rerun compilation process and when you get a success, go back to your includes/config.php file and uncomment the lines again.
    

    您应该会发现一切都恢复正常了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-09
      • 2015-09-27
      • 2014-04-24
      • 1970-01-01
      • 2010-12-28
      • 2015-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多