Symfony 3 Uploading File To S3 Bucket Error

I am using Symfony to upload a file to an amazon bucket. First off I can successfully upload this file to my Amazon bucket using the CLI but when I attempt to do it via Symfony I get this error:

"Error retrieving credentials from the instance profile metadata server. (cURL error 28: Timeout was reached)"

I am using the EXACT same credentials that I am using in the CLI, yet in Symfony, yet I just get errors…

Here’s my code…

            $s3 = new S3Client([
            $cmd = $s3->getCommand('PutObject', [
                'Bucket' => 'my-bucket-name',
                'Key'    => 'file-name.png',
                'SourceFile' => '/source/file-name.png',
                'ContentType'  => 'image/png',
                'ACL'          => 'public-read',
                'StorageClass' => 'REDUCED_REDUNDANCY'
            $result = $s3->execute($cmd);

What am I doing wrong? Thanks.

Source: stackoverflow-php

Integrating Attachment option in messaging system

We’re using a theme by Enginetheme but it don’t allow Buyers and sellers share files. Also need to refresh page each time to receive new messages/notifications.

Looking for a developer to help us add attachment option in messaging & Linking it with AWS S3 bucket. As well as making making notifications/messaging realtime.

Source: stackoverflow-php