简体   繁体   中英

S3Client gives fatal error - Fatal error: Class 'Aws\Common\Client\AbstractClient' not found

I have aws sdk in current directory. I have included sdk in file like this..

include("Aws/S3/S3Client.php");

use Aws\S3\S3Client;

class myClass{

}

It gives me fatal error like..

Fatal error: Class 'Aws\Common\Client\AbstractClient' not found in /somePath/Aws/S3/S3Client.php on line 117

Please help.

To avoid all these error while sending request or getting response from AWS, set up AWS SDK using http://aws.amazon.com/developers/getting-started/php/ , or use

git clone https://github.com/awslabs/aws-php-sample.git
curl -sS https://getcomposer.org/installer | php
php composer.phar install

By installing AWS SDK in this way, you'll get a file at vendor/autoload.php

It'll take care of all the required files into the script.

I had the exact same issue and wasn't able to find an answer anywhere. So, in case anyone has the same problem in the future, for me it was simply a matter of using a version of AWS SDK that was incompatible with my PHP version.

Once I upgraded my server's PHP version it all worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM