我在本地从事 Laravel 项目,突然开始出现以下异常:
ErrorException in FilesystemManager.php line 193:
Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php) (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php) (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php)
这个版本在服务器上运行没有任何问题。只是为了验证,我检查了相同的分支,比较composer.json
和composer.lock
文件,它们在本地和服务器上是相同的,做了一个composer update
以防万一,它仍然在本地失败,但在服务器中没有。.env
文件也是一样的。
FilesystemManager
位于 vender/laravel/framework/src/Illuminate/Filesystem 中,并且确实尝试过,use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter;
但是在服务器上运行的版本也是如此。
请注意,我根本没有使用 S3,而且我真的不想安装league/flysystem-aws-s3-v3
,因为我没有使用它。
知道有什么问题吗?
这是我的 composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.3.*",
"laravelcollective/html": "5.3.*",
"guzzlehttp/guzzle": "^6.2",
"google/cloud-storage": "1.1.5"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true
}