PHPackages                             justinmoonca/qiniu-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. justinmoonca/qiniu-php-sdk

ActiveLibrary[File &amp; Storage](/categories/file-storage)

justinmoonca/qiniu-php-sdk
==========================

Qiniu Resource (Cloud) Storage SDK for PHP

v7.6.0(3y ago)07MITPHPPHP &gt;=5.3.3

Since Oct 9Pushed 3y agoCompare

[ Source](https://github.com/justinmoonca/qiniu-php-sdk)[ Packagist](https://packagist.org/packages/justinmoonca/qiniu-php-sdk)[ Docs](http://developer.qiniu.com/)[ RSS](/packages/justinmoonca-qiniu-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (53)Used By (0)

Qiniu Cloud SDK for PHP
=======================

[](#qiniu-cloud-sdk-for-php)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/0716037609186dc86c21a616c36cf13cb46dc3722f6bc5eda06f4760ae55ad1e/68747470733a2f2f7472617669732d63692e6f72672f71696e69752f7068702d73646b2e737667)](https://travis-ci.org/qiniu/php-sdk)[![GitHub release](https://camo.githubusercontent.com/b6a7699f9d3080f0430610a5e3c6159ac4a8e78b55e50608c41f045f2ae85929/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f71696e69752f7068702d73646b2e7376673f6c6162656c3d72656c65617365)](https://github.com/qiniu/php-sdk/releases)[![Latest Stable Version](https://camo.githubusercontent.com/23fe96e0ba3b7f87f976eab93d68da1d1bbe7c37f4c6107673b4ab7f65a1574d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f71696e69752f7068702d73646b2e737667)](https://packagist.org/packages/qiniu/php-sdk)[![Total Downloads](https://camo.githubusercontent.com/0590d6e0780bba87a4ff519d06031840c82d610ad352e769a941d9caa3564e9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f71696e69752f7068702d73646b2e737667)](https://packagist.org/packages/qiniu/php-sdk)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/edfb018f799c4d2f9e81f43db5131f59f71e92451a06c111940d4e45f25f8dd3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f71696e69752f7068702d73646b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/5e99b00abcbc429d098d848ed238366468435bcebe0910928e9301aa8d6e9284/68747470733a2f2f636f6465636f762e696f2f67682f71696e69752f7068702d73646b2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/qiniu/php-sdk)[![Join Chat](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![@qiniu on weibo](https://camo.githubusercontent.com/f67a25f2f7792badc2ab789499adb3840c96e19b7bec01db1f335730e3427df2/687474703a2f2f696d672e736869656c64732e696f2f62616467652f776569626f2d25343071696e697574656b2d626c75652e737667)](http://weibo.com/qiniutek)

安装
--

[](#安装)

- 推荐使用 `composer` 进行安装。可以使用 composer.json 声明依赖，或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`](https://packagist.org/packages/qiniu/php-sdk) 。

```
$ composer require qiniu/php-sdk
```

- 直接下载安装，SDK 没有依赖其他第三方库，但需要参照 composer 的 autoloader，增加一个自己的 autoloader 程序。

运行环境
----

[](#运行环境)

Qiniu SDK版本PHP 版本7.xcURL extension, 5.3 - 5.6,7.06.xcURL extension, 5.2 - 5.6使用方法
----

[](#使用方法)

### 上传

[](#上传)

```
use Qiniu\Storage\UploadManager;
use Qiniu\Auth;
...
    $uploadMgr = new UploadManager();
    $auth = new Auth($accessKey, $secretKey);
    $token = $auth->uploadToken($bucket);
    list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath');
...
```

测试
--

[](#测试)

```
$ ./vendor/bin/phpunit tests/Qiniu/Tests/
```

常见问题
----

[](#常见问题)

- `$error` 保留了请求响应的信息，失败情况下 `ret` 为 `none`, 将 `$error` 可以打印出来，提交给我们。
- API 的使用 demo 可以参考 [examples](https://github.com/qiniu/php-sdk/tree/master/examples)。

代码贡献
----

[](#代码贡献)

详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)。

贡献记录
----

[](#贡献记录)

- [所有贡献者](https://github.com/qiniu/php-sdk/contributors)

联系我们
----

[](#联系我们)

- 如果需要帮助，请提交工单（在portal右侧点击咨询和建议提交工单，或者直接向  发送邮件）
- 如果有什么问题，可以到问答社区提问，[问答社区](https://qiniu.segmentfault.com/)
- 更详细的文档，见[官方文档站](https://developer.qiniu.com/)
- 如果发现了 bug， 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果有功能需求，欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果要提交代码，欢迎提交 pull request
- 欢迎关注我们的[微信](https://www.qiniu.com/#weixin) [微博](https://weibo.com/qiniutek)，及时获取动态信息。

代码许可
----

[](#代码许可)

The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~64 days

Total

39

Last Release

1431d ago

Major Versions

v6.1.13 → v7.0.02015-03-01

PHP version history (2 changes)v6.1.3PHP &gt;=5.2.4

v7.0.0PHP &gt;=5.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/77c04e355c1f254891b828198f29804410e448e638e647e9cba43d90bc5c4bc5?d=identicon)[justinmoonca](/maintainers/justinmoonca)

---

Top Contributors

[![rwifeng](https://avatars.githubusercontent.com/u/1814146?v=4)](https://github.com/rwifeng "rwifeng (212 commits)")[![longbai](https://avatars.githubusercontent.com/u/1204301?v=4)](https://github.com/longbai "longbai (154 commits)")[![ankadada](https://avatars.githubusercontent.com/u/26298506?v=4)](https://github.com/ankadada "ankadada (112 commits)")[![jemygraw](https://avatars.githubusercontent.com/u/1751166?v=4)](https://github.com/jemygraw "jemygraw (71 commits)")[![xushiwei](https://avatars.githubusercontent.com/u/396972?v=4)](https://github.com/xushiwei "xushiwei (70 commits)")[![timhbw](https://avatars.githubusercontent.com/u/13515277?v=4)](https://github.com/timhbw "timhbw (62 commits)")[![dtynn](https://avatars.githubusercontent.com/u/1426666?v=4)](https://github.com/dtynn "dtynn (37 commits)")[![okbang9](https://avatars.githubusercontent.com/u/84362092?v=4)](https://github.com/okbang9 "okbang9 (36 commits)")[![Mei-Zhao](https://avatars.githubusercontent.com/u/8233255?v=4)](https://github.com/Mei-Zhao "Mei-Zhao (19 commits)")[![longshanksmo](https://avatars.githubusercontent.com/u/2968746?v=4)](https://github.com/longshanksmo "longshanksmo (17 commits)")[![lihsai0](https://avatars.githubusercontent.com/u/17806506?v=4)](https://github.com/lihsai0 "lihsai0 (12 commits)")[![xwen-winnie](https://avatars.githubusercontent.com/u/10482947?v=4)](https://github.com/xwen-winnie "xwen-winnie (10 commits)")[![bachue](https://avatars.githubusercontent.com/u/321962?v=4)](https://github.com/bachue "bachue (5 commits)")[![netroby](https://avatars.githubusercontent.com/u/154278046?v=4)](https://github.com/netroby "netroby (3 commits)")[![callmez](https://avatars.githubusercontent.com/u/1625891?v=4)](https://github.com/callmez "callmez (3 commits)")[![hantuo](https://avatars.githubusercontent.com/u/873728?v=4)](https://github.com/hantuo "hantuo (2 commits)")[![hamlet120](https://avatars.githubusercontent.com/u/24295929?v=4)](https://github.com/hamlet120 "hamlet120 (2 commits)")[![peichao01](https://avatars.githubusercontent.com/u/844740?v=4)](https://github.com/peichao01 "peichao01 (2 commits)")[![liangchaoboy](https://avatars.githubusercontent.com/u/17689793?v=4)](https://github.com/liangchaoboy "liangchaoboy (2 commits)")[![justinmoonca](https://avatars.githubusercontent.com/u/15779593?v=4)](https://github.com/justinmoonca "justinmoonca (2 commits)")

---

Tags

sdkcloudstorageqiniu

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/justinmoonca-qiniu-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/justinmoonca-qiniu-php-sdk/health.svg)](https://phpackages.com/packages/justinmoonca-qiniu-php-sdk)
```

###  Alternatives

[qiniu/php-sdk

Qiniu Resource (Cloud) Storage SDK for PHP

8483.0M240](/packages/qiniu-php-sdk)[zgldh/qiniu-laravel-storage

Qiniu Resource (Cloud) Storage SDK for Laravel 5/6/7/8/9

530394.0k13](/packages/zgldh-qiniu-laravel-storage)[itbdw/laravel-storage-qiniu

A storage library for laravel5 and qiniu sdk

7015.2k](/packages/itbdw-laravel-storage-qiniu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
