Get started quickly using AWS with the AWS SDK for PHP. The SDK is a modern, open-source PHP library that makes it easy to integrate your PHP application with AWS services like Amazon S3, Amazon Glacier, and Amazon DynamoDB.
Version 3 of the AWS SDK for PHP is now generally available and includes a number of improvements and new features, while maintaining nearly identical API patterns for easy migration from the version 2.
- Asynchronous requests
- Streamlined extension architecture
- Easy result querying with JMESPath, a JSON querying language
- Response paginators
- Command pools
- Performance improvements
Amazon DynamoDB JSON and Array Marshaler
Conveniently marshal and unmarshal JSON documents and PHP arrays for storage in Amazon DynamoDB.
Amazon DynamoDB Session Handler
Remove the session state scale bottleneck by easily storing application session state in DynamoDB.
Use PHP's built-in functions such as fopen, copy, and file_get_contents to work with objects stored in Amazon S3.
Automates polling for resource state changes such as waiting for a newly launched Amazon EC2 instance to reach the 'running' state.
AWS Resource APIs provide an object-oriected abstraction over the "low-level" or RPC-style interface in the AWS SDK for PHP, for a simpler and more intuitive coding experience. A resource object is a reference to an AWS resource (such as an Amazon EC2 instance or an Amazon S3 object) that exposes the resource's attributes and actions as properties and methods of the resource object. Details of the underlying HTTP API requests become transparent, and you get to work with AWS resources as if they are local PHP objects. The sample code below demonstrates how this works. Supported services include Amazon EC2, Amazon S3, Amazon SNS, Amazon SQS, AWS IAM, Amazon Glacier, and AWS CloudFormation, and more services will be added in the future.
// The sample code below demonstrates how Resource APIs work
$aws = new Aws($config);
// Get references to resource objects
$bucket = $aws->s3->bucket('my-bucket');
$object = $bucket->object('image/bird.jpg');
// Access resource attributes
echo $object['LastModified'];
// Call resource methods to take action
$object->delete();
$bucket->delete();
Be guided on moving to latest AWS SDK for PHP in the Migration Guide »
Dig through the source code in the GitHub Repository »
Learn the details of the latest SDK in the Change Log »
Connect with other developers in the PHP Community Forum »
Discover more about using PHP with AWS in the PHP Developer Center »
Looking for old versions of AWS SDK for PHP?
The AWS SDK for PHP - Version 2 is available in the "v2" branch on GitHub
The AWS SDK for PHP - Version 1 works side–by–side with the AWS SDK for PHP.