Chapters
40 Chapters
|
4:39:58
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: ^7.1.3
Subscribe to download the code!Compatible PHP versions: ^7.1.3
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
34.
Flysystem & S3
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial is built on Symfony 4 but works great in Symfony 5!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.1.3",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.87", // 3.87.10
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"doctrine/annotations": "^1.0", // 1.10.1
"doctrine/doctrine-bundle": "^1.6.10", // 1.10.2
"doctrine/doctrine-migrations-bundle": "^1.3|^2.0", // v2.0.0
"doctrine/orm": "^2.5.11", // v2.7.2
"knplabs/knp-markdown-bundle": "^1.7", // 1.7.1
"knplabs/knp-paginator-bundle": "^2.7", // v2.8.0
"knplabs/knp-time-bundle": "^1.8", // 1.9.0
"league/flysystem-aws-s3-v3": "^1.0", // 1.0.22
"league/flysystem-cached-adapter": "^1.0", // 1.0.9
"liip/imagine-bundle": "^2.1", // 2.1.0
"nexylan/slack-bundle": "^2.0,<2.2.0", // v2.1.0
"oneup/flysystem-bundle": "^3.0", // 3.0.3
"php-http/guzzle6-adapter": "^1.1", // v1.1.1
"phpdocumentor/reflection-docblock": "^3.0|^4.0", // 4.3.0
"sensio/framework-extra-bundle": "^5.1", // v5.2.4
"stof/doctrine-extensions-bundle": "^1.3", // v1.3.0
"symfony/asset": "^4.0", // v4.2.3
"symfony/console": "^4.0", // v4.2.3
"symfony/flex": "^1.9", // v1.21.6
"symfony/form": "^4.0", // v4.2.3
"symfony/framework-bundle": "^4.0", // v4.2.3
"symfony/property-access": "4.2.*", // v4.2.3
"symfony/property-info": "4.2.*", // v4.2.3
"symfony/security-bundle": "^4.0", // v4.2.3
"symfony/serializer": "4.2.*", // v4.2.3
"symfony/twig-bundle": "^4.0", // v4.2.3
"symfony/validator": "^4.0", // v4.2.3
"symfony/web-server-bundle": "^4.0", // v4.2.3
"symfony/yaml": "^4.0", // v4.2.3
"twig/extensions": "^1.5" // v1.5.4
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0", // 3.1.0
"easycorp/easy-log-handler": "^1.0.2", // v1.0.7
"fzaninotto/faker": "^1.7", // v1.8.0
"symfony/debug-bundle": "^3.3|^4.0", // v4.2.3
"symfony/dotenv": "^4.0", // v4.2.3
"symfony/maker-bundle": "^1.0", // v1.11.3
"symfony/monolog-bundle": "^3.0", // v3.3.1
"symfony/phpunit-bridge": "^3.3|^4.0", // v4.2.3
"symfony/stopwatch": "4.2.*", // v4.2.3
"symfony/var-dumper": "^3.3|^4.0", // v4.2.3
"symfony/web-profiler-bundle": "4.2.*" // v4.2.3
}
}
21 Comments
Hello,
When install the composer require league/flysystem-aws-s3-v3 on symfony 5, the script not install config file oneup_flysystems.yaml on packages/, and the composer.json have "league/flysystem-aws-s3-v3": "^2.0".
I not understand happend. Some any idea?
Hey mitosu
Do your composer allows to install third party recipes? Inside your
composer.jsonyou should have this piece of configYou can re-run any recipe by running this command
composer recipes:install vendor/package --force -vCheers!
Greetings MolloKhan ,
I'm having the same issue as @Miguel described above and was wondering what I could do to resolve this issue.
My composer json contains the following records:
"aws/aws-sdk-php": "^3.173",<br />"league/flysystem-aws-s3-v3": "^2.0",This with allow-contrib at true and forcing the recipes to be installed, the yaml file does not generated.
if I add the file manually, then the system generates the following error:
<blockquote>There is no extension able to load the configuration for "oneup_flysystem" (in "/var/www/config/packages/oneup_flysystem.yaml")</blockquote>
From what i can see, is that the oneup/flysystem-bundle is no longer part of the package when installing flysystem-aws-s3-v3 as this is not compatible with league/flysystem
EDIT: i was able to resolve to lock the packages to the versions you used in the video from the composer.json.
It seems the new version of flysystem-aws-s3-v3 is operating differently and no longer requires the flysystem-bundle
Hey Nikolaj M.
Did you get that error after installing the
oneup/flysystem-bundlebundle? As I can tell the bundle configuration still exists in the master branch https://github.com/1up-lab/OneupFlysystemBundle/blob/master/src/DependencyInjection/OneupFlysystemExtension.phpCheers!
Hey @Diego, sorry for the late response. The problem lied in the fact that the new league/flysystem-aws-s3-v3 comes with a different recipe and thus does not install the flysystem-bundle. When I installed the package versions you used in this demo, the functionalities work just fine as expected/explained. I tried installing the bundle manually but the updated s3 package does not use it so a different configuration/method is required then what is documented here.
Perhaps it would be good to update the text with the used version number to prevent users having the same issue in the future.
Hey Nikolaj Malezsewski and Nikolaj
I tried to replicate this problem by creating a new Sf5 project and install both libraries. I didn't get any errors. So, seems like we got confused. The package
league/flysystem-aws-s3-v3does not install any recipes because it has nothing to do with Symfony but the bundleoneup/flysystem-bundleis the one which comes with a recipe. Is there a chance that you added theconfig/packages/oneup_flysystem.yamlfile before installing the bundle?Hey Nikolaj Malezsewski
Thanks for the explanation, it's clearer now what happened. We'll add a note on the video to avoid this hassle to other users. Thanks!
Hello, I see that we are required to enter our credit card to create an account on AWS, even to take advantage of only the free option. I would just like to use it to find out for now. Is it possible to create an account with my credit card in it, then cancel just before the end of my free period in order to pay nothing? And why not recreate an account and benefit from the free period again?
Hey Kiuega!
> Hello, I see that we are required to enter our credit card to create an account on AWS, even to take advantage of only the free option
It's been so long since I signed up, I wasn't aware of that! I get why they do it - but yea, it's unfortunate for testing :/.
> Is it possible to create an account with my credit card in it, then cancel just before the end of my free period in order to pay nothing?
If I remember correctly (but I may not), it's not exactly a free period (e.g. free 1 month), it's a free "tier". Like you can use a certain number of free EC2 hours per month... though all of this only applies for the first 12 months of your account. My point is, if you stick to the truly free features/tiers, then you don't need to cancel at all: you're simply not charged. S3 also has a free tier - https://aws.amazon.com/s3/p...
> And why not recreate an account and benefit from the free period again?
You could - but you'd have to do it every 12 months and the only thing you'd be getting for free are really low-level EC2 instances, S3 etc. It's not a ton of value.
By the way, they have a good cost tracker in the billing section. If you accidentally started using something that's not free, you could find out pretty quickly (probably before you spend even $1).
Cheers!
Hey team,
I have an error when installing composer require league/flysystem-aws-s3-v3
<br />PS C:\xampp\htdocs\SymfonyCasts\Symfony4\AllaboutUplFiles\01_start> composer require league/flysystem-aws-s3-v3<br />Using version ^1.0 for league/flysystem-aws-s3-v3<br />./composer.json has been updated<br />Loading composer repositories with package information<br />Updating dependencies (including require-dev)<br />Restricting packages listed in "symfony/symfony" to "4.2.*"<br />Nothing to install or update<br />Package easycorp/easy-log-handler is abandoned, you should avoid using it. No replacement was suggested.<br />Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.<br />Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.<br />Generating autoload files<br />3 packages you are using are looking for funding.<br />Use thecomposer fundcommand to find out more!<br />ocramius/package-versions: Generating version class...<br />ocramius/package-versions: ...done generating version class<br />Executing script cache:clear [KO]<br /> [KO]<br />3 packages you are using are looking for funding.<br />Use thecomposer fund` command to find out more!ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In CheckDefinitionValidityPass.php line 69:
!!
!! The definition for "arguments" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true.
!! If this is an abstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this
e
!! rror.
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json to its original content.
`
In services.yaml
services:
I don't know that synthetic=true should be declared.
I would appreciate your help !
Hey Raed
That's odd. Would be nice to know which service is triggering that error. If you clear your cache without installing that bundle, does the error happens?
Also, try re-installing your vendors
Hey MolloKhan,
Thanks for your reply!
I could install the composer require league/flysystem-aws-s3-v3
Then i removed the vendor and tried to run composer install however i had the same error the installation could 'not be completed
the error :
!! In CheckDefinitionValidityPass.php line 69:
!!
!! The definition for "arguments" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true. If this is an
!! abstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this error.
!!
Hmm, we need to gather more information. Can you "composer install" again but passing in
-vvvso we can get more debugging info. Also, can you tell me which Symfony version are you using and what OS you are using?Hey <
`code>
`MolloKhan,
Thanks for your reply !
After i tried to run "composer install -vvv" i got :
`
Reading ./composer.json
Loading config file ./composer.json
Checked CA file C:\Users\Raed\AppData\Local\Temp\ope6C68.tmp: valid
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): git branch --no-color --no-abbrev -v
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): git describe --exact-match --tags
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): git log --pretty="%H" -n1 HEAD
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): hg branch
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): fossil branch list
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): fossil tag list
Executing command (C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start): svn info --xml
Reading C:/Users/Raed/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Raed/AppData/Roaming/Composer/composer.json
Reading C:\xampp\htdocs\SymfonyCasts2\Symfony4\AllaboutUplFiles\01_start/vendor/composer/installed.json
Reading C:/Users/Raed/AppData/Roaming/Composer/vendor/composer/installed.json
Loading plugin Symfony\Flex\Flex
Loading plugin PackageVersions\Installer
Running 1.10.7 (2020-06-03 10:03:56) with PHP 7.4.5 on Windows NT / 10.0
Reading ./composer.lock
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Reading ./composer.lock
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.028 seconds
Analyzed 291 packages to resolve dependencies
Analyzed 1135 rules to resolve dependencies
Nothing to install or update
Package easycorp/easy-log-handler is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Generating autoload files
17 packages you are using are looking for funding.
Use the
composer fundcommand to find out more!ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Looking at all rules.
Dependency resolution completed in 0.028 seconds
Analyzed 291 packages to resolve dependencies
Analyzed 1135 rules to resolve dependencies
Nothing to install or update
Package easycorp/easy-log-handler is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Generating autoload files
17 packages you are using are looking for funding.
Use the
composer fundcommand to find out more!ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Thanks for your help !
Hey Raed!
Hmm. I have a feeling, but I could be wrong, that this is not directly related to installing the
league/flysystem-aws-s3-v3package. The error makes it seem like you have this in a service file somewhere (e.g. in yourservices.yamlfile):Do you see the problem? In my code,
argumentsis NOT indented under theSome\ServiceHereservice - it should have 8 spaces in front of it, not 4. With this config (or, at least some config like this), Symfony would think thatargumentsis the id of a new service that we're registering. And then it would fail because we never set a "class" for this service.So, double-check your service code everywhere. In theory, you should be seeing this code even if you uninstalled the library. If you can't find it, post your
services.yamlfile and we'll see if we can spot the problem :).Cheers!
Hey Raed
Which PHP version do you use? Second question did the bundle installed? I don't see installation records in your log.
Cheers!
Hey sadikoff,
I use version PHP 7.4.5. The bundle could'not be installed.
I have the same error, what can I do ?
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)Hey Patrick,
Could you explain what exactly are you doing when seeing this error?
Cheers!
Anyone facing (faced) this ugly error?
AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl...
I've read tons of articles about it, but nothing worked....(I'm on Windows, symfony local cert authority installed)
Thanks!
Hey Edison V.
We were applying some changes to our Challenges system but it should be OK now. I'm sorry for any inconvenience
Cheers!
"Houston: no signs of life"
Start the conversation!