问题
connect my laravel 5.4 application in heroku with aws s3 to save and display images that I upload with a dashboard.
In local I have no problem with uploading and viewing the images, even these are stored in the bucket I made. But when I set up aws in heroku to do tests there, I get the error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter'
I already removed and reinstalled the package from composer, I do not know why the error does not appear in my local environment.
thank you very much.
回答1:
you forgot to install the required library
composer require league/flysystem-aws-s3-v3
good luck
回答2:
@localheinz When I did the deploy I run: composer install
But in heroku the packages install them from the console that has the heroku dashboard.
But when I want to add or remove the package league/flysystem-aws-s3-v3 the following message comes out:
Package listed for update is not installed. Ignoring.
So I think there's a cache in between, because everything works fine for me.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.4",
"fzaninotto/faker": "^1.6",
"laravel/framework": "5.4.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"unisharp/laravel-ckeditor": "^4.6",
"league/flysystem-aws-s3-v3": "~1.0"
},
"require-dev": {
"mockery/mockery": "0.9.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
回答3:
For me I had the same issue and tried many solutions but nothing worked with me. Finally I found out that flysystem-aws-s3-v2
is in composer.lock although I was using flysystem-aws-s3-v3
with the command: composer require league/flysystem-aws-s3-v3
which doesn't change anything in composer.lock
so what I did is that I removed vendor
folder and composer.lock
file and run composer install
and that solved the problem for me.
来源:https://stackoverflow.com/questions/45619465/class-league-flysystem-awss3v3-awss3adapter-not-found-laravel-heroku