aws/aws-sdk-php
Composer 安装命令:
composer require aws/aws-sdk-php
包简介
AWS SDK for PHP - Use Amazon Web Services in your PHP project
README 文档
README
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.
Jump To:
- Getting Started
- Quick Examples
- Getting Help
- Features
- Contributing
- More Resources
- Related AWS Projects
Getting Started
- Sign up for AWS – Before you begin, you need to sign up for an AWS account and retrieve your AWS credentials.
- Minimum requirements – To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 8.1. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL).
- 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-phppackage. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:
Please see the Installation section of the User Guide for more detailed information about installing the SDK through Composer and other means.composer require aws/aws-sdk-php - 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.
- Removing unused services — To date, there are over 400 AWS services available for use with this SDK. You will likely not need them all. If you use Composer and would like to learn more about this feature, please read the linked documentation.
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\S3\Exception\S3Exception $e) { echo "There was an error uploading the file.\n"; }
Getting Help
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.
- Ask a question on StackOverflow and tag it with
aws-php-sdk - Come join the AWS SDK for PHP gitter
- Open a support ticket with AWS Support
- If it turns out that you may have found a bug, please open an issue
This SDK implements AWS service APIs. For general issues regarding the AWS services and their limitations, you may also take a look at the Amazon Web Services Discussion Forums.
Maintenance and support for SDK major versions
For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide:
Opening Issues
If you encounter a bug with aws-sdk-php we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of aws-sdk-php, PHP version and OS you’re using. Please include a stack trace and a simple workflow to reproduce the case when appropriate, too.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using aws-sdk-php please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues lean we can respond in a timely manner.
Features
- Provides easy-to-use HTTP clients for all supported AWS 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 an Amazon S3 Encryption Client for creating and interacting with encrypted objects in your S3 buckets.
- 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.
Contributing
We work hard to provide a high-quality and useful SDK for our AWS services, and we greatly value feedback and contributions from our community. Please review our contributing guidelines before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.
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)
Related AWS Projects
- AWS Service Provider for Laravel
- AWS SDK ZF2 Module
- AWS Service Provider for Silex
- AWS SDK Bundle for Symfony
- Amazon SNS Message Validator for PHP - SNS validator without requiring SDK
- Guzzle Version 7 – PHP HTTP client and framework
- For Version 2 of the SDK (deprecated):
- Serverless LAMP stack guide - A guide to building and deploying a serverless PHP application
- Other AWS SDKs & Tools (e.g., js, cli, ruby, python, java, etc.)
aws/aws-sdk-php 适用场景与选型建议
aws/aws-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 548.48M 次下载、GitHub Stars 达 6.2k, 最近一次更新时间为 2012 年 11 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「amazon」 「s3」 「sdk」 「cloud」 「aws」 「dynamodb」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aws/aws-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aws/aws-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aws/aws-sdk-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
Small library to access Microsoft Windows Azure Blob Storage with a Service or a StreamWrapper.
This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.
UCloud Resource (Cloud) Storage SDK for PHP
The flysystem adapter for yandex disk rest api.
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
统计信息
- 总下载量: 548.48M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6349
- 点击次数: 27
- 依赖项目数: 2517
- 推荐数: 398
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2012-11-02