0
我在更新我的magento 2網站時遇到了一個錯誤,因爲那個錯誤我無法做任何事情,例如:我無法編譯,更新&部署靜態內容。在autoload.php中找不到autoloader registery
以下是錯誤:
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
任何人都可以請幫我解決這個問題。我已經更新了作曲家,但仍然存在相同的錯誤,請參閱此截圖作爲參考
這裏是我的自動加載文件:
<?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, []);
我們已經嘗試了作曲家更新,作曲家安裝和作曲家轉儲自動加載。仍然存在相同的錯誤。 – Varma
在安裝文件夾中運行命令「composer update」也是按照這裏建議的https://github.com/magento/magento2/issues/794 –