Search code examples
phpamazon-s3symfony4

Symfony 4 S3Client::factory issue: 'class Aws\S3\S3Client not found'


I am trying getObject() from aws bucket, but when try s3Client, error: 'class Aws\S3\S3Client not found'

$s3Client = S3Client::factory([
  'credentials' => [
  'key'    => $key,
  'secret' => $secret
  ],
'region' => $region,
'version' => 'latest',
'scheme' => 'http'
             ]);

Solution

  • It seems like the aws skd isn't installed. Try to install by command

    composer require aws/aws-sdk-php