在autoload.php中找不到Autoloader注册表

时间:2017-08-25 10:11:31

标签: composer-php magento2

我在更新我的magento 2网站时遇到错误,因为该错误我无法做任何事情:我无法编译,更新和放大部署静态内容。

这是错误:

PHP Fatal error:  Uncaught Error: Class 'Magento\Framework\Autoload\AutoloaderRe                      gistry' not found in /var/www/vhosts/potboy.com.my/httpdocs/app/autoload.php:37
Stack trace:
#0 /var/www/vhosts/potboy.com.my/httpdocs/app/bootstrap.php(30): require_once()
#1 /var/www/vhosts/potboy.com.my/httpdocs/bin/magento(14): require('/var/www/vho                      sts...')
#2 {main}
  thrown in /var/www/vhosts/potboy.com.my/httpdocs/app/autoload.php on line 37

任何人都可以帮我解决这个问题。我已经更新了作曲家,但仍然存在相同的错误,请找到此屏幕截图供参考

screenshot

这是我的自动加载文件:

<?php
/**
 * Register basic autoloader that uses include path
 *
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
use Magento\Framework\Autoload\AutoloaderRegistry;
use Magento\Framework\Autoload\ClassLoaderWrapper;

/**
 * Shortcut constant for the root directory
 */
define('BP', dirname(__DIR__));

define('VENDOR_PATH', BP . '/app/etc/vendor_path.php');

if (!file_exists(VENDOR_PATH)) {
    throw new \Exception(
        'We can\'t read some files that are required to run the Magento application. '
         . 'This usually means file permissions are set incorrectly.'
    );
}

$vendorDir = require VENDOR_PATH;
$vendorAutoload = BP . "/{$vendorDir}/autoload.php";

/* 'composer install' validation */
if (file_exists($vendorAutoload)) {
    $composerAutoloader = include $vendorAutoload;
} else {
    throw new \Exception(
        'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
    );
}

AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));

// Sets default autoload mappings, may be overridden in Bootstrap::create
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);

1 个答案:

答案 0 :(得分:0)

看起来Magento找不到vendor / magento / framework / Autoload / AutoloaderRegistry.php

你可以检查上面的文件是否存在,如果不是,那么首先运行命令&#34; composer update&#34;从Magento安装的根目录开始。