7

I've migrated servers and updated AWS phar, however once i've done that i'm getting the following error:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Missing required client configuration options: version: (string) A "version" configuration value is required. Specifying a version constraint ensures that your code will not be affected by a breaking change made to the service. For example, when using Amazon S3, you can lock your API version to "2006-03-01". Your build of the SDK has the following version(s) of "email": * "2010-12-01" You may provide "latest" to the "version" configuration value to utilize the most recent available API version that your client's API provider can find. Note: Using 'latest' in a production application is not recommended. A list of available API versions can be found on each client's API documentation page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are unable to load a specific API version, then you may need to update your copy of the SDK.' in phar:////includes/3rdparty/aws/aws.phar/Aws/ in phar:////includes/3rdparty/aws/aws.phar/Aws/ClientResolver.php on line 328

I've tried adding it via different method and looking into the actual documentation without any luck.

Here's my code right now:

$client = SesClient::factory(array(
    'user'   => 'uuuuu',
    'key'    => 'aaaaa',
    'secret' => 'bbbb',
    'region' => 'us-east-1',
));

$client->version("2010-12-01"); 
//Now that you have the client ready, you can build the message
$msg = array(); 
//more  code after this... 

Any help would be appreciated!

Danila Ganchar
  • 10,266
  • 13
  • 49
  • 75
Saulius Antanavicius
  • 1,371
  • 6
  • 25
  • 55

2 Answers2

4

Apparenty, the 'version' field is mandatory now, so you must pass it to the factory.

Elie Roux
  • 425
  • 1
  • 3
  • 17
  • this is correct. Also for the newer versions, key and secret must be passed like this: http://stackoverflow.com/a/31582475 – Jack Franzen Oct 26 '15 at 07:14
4

enter image description here

Source: http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/migration.html

// Instantiate the client with your AWS credentials
$client = SqsClient::factory(array(
    'credentials' => $credentials,
    'region'  => 'us-east-1',
    'version' => '2012-11-05'
));
mboy
  • 744
  • 7
  • 17