Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK ver 2 & 3 conflict in PHP 7.0 #1438

Closed
shuhailshuvo opened this issue Dec 11, 2017 · 1 comment
Closed

SDK ver 2 & 3 conflict in PHP 7.0 #1438

shuhailshuvo opened this issue Dec 11, 2017 · 1 comment
Labels
guidance Question that needs advice or information.

Comments

@shuhailshuvo
Copy link

require_once '../aws/aws-autoloader.php';

$config = [
    'region'  => 'ap-south-1',
    'version' => 'latest',
    'credentials' => [
        'key'    => '...',
        'secret' => '...'
    ]
];
$sdk = new Aws\Sdk($config);
$client = $sdk->createS3();

shows following error:

Fatal error: Uncaught TypeError: Argument 1 passed to Aws\Common\Client\AbstractClient::__construct() must be an instance of Aws\Common\Credentials\CredentialsInterface, array given, called in /var/www/html/webservice/vendor/aws3/Aws/Sdk.php on line 316 and defined in /var/www/html/aws-sdk/vendor/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php:75 Stack trace: #0 /var/www/html/webservice/vendor/aws3/Aws/Sdk.php(316): Aws\Common\Client\AbstractClient->__construct(Array) #1 /var/www/html/webservice/vendor/aws3/Aws/Sdk.php(291): Aws\Sdk->createClient('S3', Array) #2 index.php(14): Aws\Sdk->__call('createS3', Array) thrown in /var/www/html/aws-sdk/vendor/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php on line 75

I have both AWS SDK version 2 & 3 in my project. this might be a issue of conflict. Then how to solve the conflict?

@kstich kstich added the guidance Question that needs advice or information. label Dec 11, 2017
@kstich
Copy link
Contributor

kstich commented Dec 11, 2017

Running version 2 and 3 of the AWS SDK for PHP together is not possible. You can follow the upgrading guide and use the compatibility test included in version 3 of the SDK to help update.

@kstich kstich closed this as completed Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants