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.
Conveniently marshal and unmarshal JSON documents and PHP arrays for storage in Amazon DynamoDB.
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
// Call resource methods to take action
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?