Installation guide
...Or by using the the tilde operator. The following statement is equivalent to >=2.4.9,<2.5:
{
"require": {
"aws/aws-sdk-php": "~2.4.9"
}
}
See the Composer documentation for more information on configuring your dependencies.
The SDK may at some point adopt the semver standard, but this will probably not happen until the next
paradigm-type change.
Why am I seeing a "Cannot redeclare class" error?
We have observed this error a few times when using the aws.phar from the CLI with APC enabled. This is due to
some kind of issue with phars and APC. Luckily there are a few ways to get around this. Please choose the one that
makes the most sense for your environment and application.
1. Disable APC for CLI - Change the apc.enable_cli INI setting to Off.
2. Tell APC not to cache phars - Change the apc.filters INI setting to include "^phar://".
3. Don't use APC - PHP 5.5, for example, comes with Zend OpCache built in. This problem has not been
observed with Zend OpCache.
4. Don't use the phar - You can install the SDK through Composer (recommended) or by using the zip file.
What is an InstanceProfileCredentialsException?
If you are seeing an Aws\Common\Exception\InstanceProfileCredentialsException while using the
SDK, this means that the SDK was not provided with any credentials.
If you instantiate a client without credentials, on the first time that you perform a service operation, the SDK will
attempt to find credentials. It first checks in some specific environment variables, then it looks for instance profile
credentials, which are only available on configured Amazon EC2 instances. If absolutely no credentials are provided
or found, an Aws\Common\Exception\InstanceProfileCredentialsException is thrown.
If you are seeing this error and you are intending to use instance profile credentials, then you need to make sure
that the Amazon EC2 instance that the SDK is running on is configured with an appropriate IAM role.
If you are seeing this error and you are not intending to use instance profile credentials, then you need to make sure
that you are properly providing credentials to the SDK.
For more information, see Providing Credentials to the SDK.
Auto Scaling
This guide focuses on the AWS SDK for PHP client for Auto Scaling. This guide assumes that you have already
downloaded and installed the AWS SDK for PHP. See Installation for more information on getting started.
Creating a client
First you need to create a client object using one of the following techniques.
Factory method
The easiest way to get up and running quickly is to use the
Aws\AutoScaling\AutoScalingClient::factory() method and provide your credentials (key and
secret).
A region parameter is also required and must be set to one of the following values: us-east-1,
ap-northeast-1, sa-east-1, ap-southeast-1, ap-southeast-2, us-west-2, us-gov-west-1,
us-west-1, cn-north-1, eu-west-1
Auto Scaling
49