无法打开'... / includes / src / __ adminhtml.php'以包含

时间:2017-11-07 15:22:36

标签: php magento

我无法访问Magento管理员端我正在获取白屏,当我打开错误报告时,我收到此消息:

Array
(
    [type] => 2
    [message] => include_once(): Failed opening '/home/domain/www/www/includes/src/__adminhtml.php' for inclusion (include_path='/home/domain/www/www/includes/src:.:/usr/local/php56/lib/php')
    [file] => /home/domanin/www/www/includes/src/Varien_Autoload.php
    [line] => 108
)

所以基本上我清理已编译的文件并重新运行编译后,在我的includes文件夹中没有__adminhtml.php文件,清除缓存,一切都是一样的。

一件奇怪的事情是,当我跑步时,我总是得到编译器:禁用状态:

php -f shell/compiler.php -- state

即使在跑步之后:

1. php -f shell/compiler.php -- disable
2. php -f shell/compiler.php -- clear
3. php -f shell/compiler.php -- compile
4. php -f shell/compiler.php -- enable

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

在我的1.9.3.6实例中,未生成__adminhtml.php

然而,在Varien_Autoload.php中,您的网站在这里打破:

static public function registerScope($code)
    {
        self::$_scope = $code;
        if (defined('COMPILER_INCLUDE_PATH')) {
            @include_once COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . self::SCOPE_FILE_PREFIX.$code.'.php';
        }
    }

具体来说,第108行:

@include_once COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . self::SCOPE_FILE_PREFIX.$code.'.php';

@符号表示如果找不到该文件,则不应该出错。

我会在lib/Varien/Autoload.php中检查此行,如果不存在,请添加@符号。另外,检查它是否已复制到app/code/local/Varien/Autoload.php并在那里修复它。然后清除并重新运行编译过程。

如果这不是问题,那么它可能与错误报告有关。见这里:http://php.net/manual/en/language.operators.errorcontrol.php。有些东西可能会覆盖默认行为,以便在找不到文件时抛出错误。

您可能有一个设置自定义错误处理程序的扩展程序或工具。格雷普为set_error_handlersetErrorHandler,并查看app/code/localapp/code/community中是否有任何文件。如果error_reporting为零,则需要修复错误处理程序以返回false。例如:

// From: http://php.net/manual/en/function.set-error-handler.php
if (!(error_reporting() & $errno)) {
    // This error code is not included in error_reporting, so let it fall
    // through to the standard PHP error handler
    return false;
}

如果它不是扩展名,则最后查看的位置是functions.php。默认错误处理程序mageCoreErrorHandler()是默认使用的。它可能已被修改。检查app/code/local/Mage/Core/functions.php中是否有副本。如果您这样做,则将mageCoreErrorHandler()方法替换为1.9.3.6源代码中的代码,或者像上面的示例中那样修复它。

如果您没有本地副本,那么您的核心functions.php文件可能已损坏,您需要使用1.9.3.6源中的新副本替换它(或者如果它是自定义的,则复制它到app/code/local,修复了错误报告,并在app/code/core中保留了未经修改的1.9.3.6版本。

相关问题