Installation guide

In the following example, the Amazon S3 Client is used to create a bucket. Then the waiter method is used to wait
until the bucket exists.
// Create a bucket
$s3Client->createBucket(array('Bucket' => 'my-bucket'));
// Wait until the created bucket is available
$s3Client->waitUntilBucketExists(array('Bucket' => 'my-bucket'));
To learn more about how to use and configure waiters, please read the detailed guide to Waiters.
Iterators
Some AWS operations return truncated results that require subsequent requests in order to retrieve the entire result
set. The subsequent requests typically require pagination tokens or markers from the previous request in order to
retrieve the next set of results. Working with these tokens can be cumbersome, since you must manually keep track
of them, and the API for each service may differ in how it uses them.
The AWS SDK for PHP has a feature called iterators that allow you to retrieve an entire result set without manually
handling pagination tokens or markers. The iterators in the SDK implement PHP's Iterator interface, which
allows you to easily enumerate or iterate through resources from a result set with foreach.
You can find a list of the iterators supported by a client by viewing the docblock of a client. Any @method tag that
has a name that looks like "get[…]Iterator" will return an iterator. For example, the following code uses the
getListObjectsIterator() method of the S3 client object to create an iterator for objects in a bucket.
$iterator = $client->getListObjectsIterator(array('Bucket' => 'my-bucket'));
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
To learn more about how to use and configure iterators, please read the detailed guide to Iterators.
Migration Guide
This guide shows how to migrate your code to use the new AWS SDK for PHP and how the new SDK differs from
the AWS SDK for PHP - Version 1.
Introduction
The PHP language and community have evolved significantly over the past few years. Since the inception of the
AWS SDK for PHP, PHP has gone through two major version changes (versions 5.3 and 5.4) and many in the PHP
community have unified behind the recommendations of the PHP Framework Interop Group. Consequently, we
decided to make breaking changes to the SDK in order to align with the more modern patterns used in the PHP
community.
For the new release, we rewrote the SDK from the ground up to address popular customer requests. The new SDK
is built on top of the Guzzle HTTP client framework, which provides increased performance and enables
event-driven customization. We also introduced high-level abstractions to make programming common tasks easy.
The SDK is compatible with PHP 5.3.3 and newer, and follows the PSR-0 standard for namespaces and
autoloading.
Which Services are Supported?
The AWS SDK for PHP supports all of the AWS services supported by Version 1 of the SDK and more, including
Amazon Route 53, Amazon Glacier, and AWS Direct Connect. See the AWS SDK for PHP website for the full list of
services supported by the SDK. Be sure to watch or star our AWS SDK for PHP GitHub repository to stay up-to-date
with the latest changes.
What's New?
Migration Guide
8