Giter Club home page Giter Club logo

aws-sdk-php's Introduction

AWS SDK for PHP - Version 3

@awsforphp on Twitter Total Downloads Build Status Apache 2 License ![Gitter](https://badges.gitter.im/Join Chat.svg)

The AWS SDK for PHP makes it easy for developers to access Amazon Web Services in their PHP code, and build robust applications and software using services like Amazon S3, Amazon DynamoDB, Amazon Glacier, etc. You can get started in minutes by installing the SDK through Composer or by downloading a single zip or phar file from our latest release.

Resources

  • User Guide – For both getting started and in-depth SDK usage information
  • API Docs – For details about operations, parameters, and responses
  • Blog – Tips & tricks, articles, and announcements
  • Sample Project - A quick, sample project to help get you started
  • Forum – Ask questions, get help, and give feedback
  • Issues – Report issues, submit pull requests, and get involved (see Apache 2.0 License)
  • @awsforphp – Follow us on Twitter
  • For Version 2 of the SDK:

Features

  • Provides easy-to-use HTTP clients for all supported AWS [services][docs-services], regions, and authentication protocols.
  • Is built on Guzzle, and utilizes many of its features, including persistent connections, asynchronous requests, middlewares, etc.
  • Provides convenience features including easy result pagination via Paginators, Waiters, and simple Result objects.
  • Provides a multipart uploader tool for Amazon S3 and Amazon Glacier that can be paused and resumed.
  • Provides an Amazon S3 Stream Wrapper, so that you can use PHP's native file handling functions to interact with your S3 buckets and objects like a local filesystem.
  • Provides the Amazon DynamoDB Session Handler for easily scaling sessions on a fast, NoSQL database.
  • Automatically uses IAM Instance Profile Credentials on configured Amazon EC2 instances.

Getting Started

  1. Sign up for AWS – Before you begin, you need to sign up for an AWS account and retrieve your AWS credentials.
  2. Minimum requirements – To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 5.5 compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL).
  3. Install the SDK – Using Composer is the recommended way to install the AWS SDK for PHP. The SDK is available via Packagist under the aws/aws-sdk-php package. Please see the Installation section of the User Guide for more detailed information about installing the SDK through Composer and other means.
  4. Using the SDK – The best way to become familiar with how to use the SDK is to read the User Guide. The Getting Started Guide will help you become familiar with the basic concepts.

Quick Examples

Create an Amazon S3 client

<?php
// Require the Composer autoloader.
require 'vendor/autoload.php';

use Aws\S3\S3Client;

// Instantiate an Amazon S3 client.
$s3 = new S3Client([
    'version' => 'latest',
    'region'  => 'us-west-2'
]);

Upload a file to Amazon S3

<?php
// Upload a publicly accessible file. The file size and type are determined by the SDK.
try {
    $s3->putObject([
        'Bucket' => 'my-bucket',
        'Key'    => 'my-object',
        'Body'   => fopen('/path/to/file', 'r'),
        'ACL'    => 'public-read',
    ]);
} catch (Aws\Exception\S3Exception $e) {
    echo "There was an error uploading the file.\n";
}

Related Projects

aws-sdk-php's People

Contributors

acoulton avatar adrienbrault avatar alexkovalevych avatar andythorne avatar beefcakefu avatar brendandixon avatar carljparker avatar danadesrosiers avatar danielcosta avatar davedevelopment avatar deviantintegral avatar eronhennessey avatar frankdejonge avatar grahamcampbell avatar hacfi avatar hidehara avatar jeremeamia avatar jeskew avatar johannesnagl avatar martinssipenko avatar miklos-martin avatar mtdowling avatar pborreli avatar pcolby avatar poisa avatar radford avatar rlerdorf avatar skyzyx avatar xgin avatar xterr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.