PHPackages                             starfalling/aliyun-tablestore-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. [Database &amp; ORM](/categories/database)
4. /
5. starfalling/aliyun-tablestore-php-sdk

ActiveLibrary[Database &amp; ORM](/categories/database)

starfalling/aliyun-tablestore-php-sdk
=====================================

Aliyun Tablestore SDK for PHP

v5.0.3.5(4y ago)165.0k—3.2%2MITPHPPHP &gt;=5.5

Since Feb 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/starfalling/aliyun-tablestore-php-sdk)[ Packagist](https://packagist.org/packages/starfalling/aliyun-tablestore-php-sdk)[ Docs](http://www.aliyun.com/product/ots)[ RSS](/packages/starfalling-aliyun-tablestore-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (18)Used By (0)

Aliyun TableStore SDK for PHP - Version 5
=========================================

[](#aliyun-tablestore-sdk-for-php---version-5)

说明
==

[](#说明)

Aliyun OTS SDK for PHP，用来通过PHP访问阿里云OTS服务。

适用于PHP 5.5 及以上版本，包括7.0、7.1、7.2。只支持64位的PHP系统。推荐使用PHP7，以得到最好的性能。

当前仅支持Linux，其他系统需要用户自己改造代码支持。

使用步骤
====

[](#使用步骤)

1. 请确认你的PHP版本为 5.5 或更高。你可以通过运行 php --version 获知你当前使用的PHP版本。
2. 设置PHP的时区，在 php.ini（要知道你正在使用的php.ini文件的位置，请执行命令 php --ini）中添加一行：

    date.timezone = Asia/Shanghai （请根据你当地的时区进行设置）
3. 设置PHP的内存使用限制为512M或者更高。同样是在 php.ini 中修改：

    memory\_limit = 512M
4. 下载SDK并解压到本地。
5. 安装依赖。在解压后的目录中执行命令：

    php tools/composer.phar install --no-dev
6. 生成 autoload。 在解压后的目录中执行命令：

    php tools/composer.phar dumpautoload --no-dev

    这条命令会生成 vendor/autoload.php 文件。
7. 在你的PHP代码文件中引用（require）上一个步骤中生成的 vendor/autoload.php 文件。

编程文档
====

[](#编程文档)

我们提供了HTML格式的文档，请在浏览器中打开这些文档。

1. 文档主页：docs/index.html
2. SDK的调用入口 OTSClient：docs/classes/Aliyun.OTS.OTSClient.html

    这个文档中有丰富的代码样例，详细说明了每个API的使用方法。
3. 客户端配置：docs/classes/Aliyun.OTS.OTSClientConfig.html
4. 重试策略：docs/namespaces/Aliyun.OTS.Retry.html
5. 服务端返回的错误：docs/classes/Aliyun.OTS.OTSServerException.html
6. 客户端返回的错误：docs/classes/Aliyun.OTS.OTSClientException.html

### 运行Sample程序

[](#运行sample程序)

1. 修改 `examples/ExampleConfig.php`， 补充配置信息
2. 执行 `cd examples/`
3. 选择需要的样例运行，例如 `php PKAutoIncrment.php`, 表格列自增功能的示例。

### 运行单元测试

[](#运行单元测试)

1. 执行`composer install`下载依赖的库
2. 如果是php 7.2，还需要 `composer require --dev phpunit/phpunit "^5.7.11"`，升级下phpunit的版本，才能支持。
3. 设置环境变量

    ```
     export SDK_TEST_ACCESS_KEY_ID=access-key-id
     export SDK_TEST_ACCESS_KEY_SECRET=access-key-secret
     export SDK_TEST_END_POINT=endpoint
     export SDK_TEST_INSTANCE_NAME=instance-name

    ```
4. 执行 `php vendor/bin/phpunit`

贡献代码
----

[](#贡献代码)

- 我们非常欢迎大家为TableStore PHP SDK以及其他阿里云SDK贡献代码

帮助和支持 FAQ
=========

[](#帮助和支持-faq)

- [阿里云TableStore官方网站](http://www.aliyun.com/product/ots)
- [阿里云TableStore官方论坛](http://bbs.aliyun.com)
- [阿里云TableStore官方文档中心](https://help.aliyun.com/product/8315004_ots.html)
- [阿里云云栖社区](http://yq.aliyun.com)
- [阿里云工单系统](https://workorder.console.aliyun.com/#/ticket/createIndex)

### 扫码加入TableStore讨论群，和我们直接交流讨论

[](#扫码加入tablestore讨论群和我们直接交流讨论)

[![tablestoregroup](https://camo.githubusercontent.com/070a5ae9c41f5650a73217d83c8652c8b38c33f4bb65e71ebdeb374b92152865/68747470733a2f2f7461626c6573746f72652d646f632e6f73732d636e2d68616e677a686f752e616c6979756e63732e636f6d2f7461626c6573746f72655f64696e6764696e672e6a70673f782d6f73732d70726f636573733d696d6167652f726573697a652c6d5f6c6669742c685f343030)](https://camo.githubusercontent.com/070a5ae9c41f5650a73217d83c8652c8b38c33f4bb65e71ebdeb374b92152865/68747470733a2f2f7461626c6573746f72652d646f632e6f73732d636e2d68616e677a686f752e616c6979756e63732e636f6d2f7461626c6573746f72655f64696e6764696e672e6a70673f782d6f73732d70726f636573733d696d6167652f726573697a652c6d5f6c6669742c685f343030)

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

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 ~96 days

Recently: every ~191 days

Total

16

Last Release

1541d ago

Major Versions

v2.1.1 → v4.0.02018-05-30

v4.1.1.1 → v5.0.02019-05-30

v4.1.1.3 → v5.0.3.12020-01-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/08ae87a08d41f9f7b56355d151ee662d8d6c051128d7bd15e0f171277a81482c?d=identicon)[starfalling](/maintainers/starfalling)

---

Top Contributors

[![starfalling](https://avatars.githubusercontent.com/u/532951?v=4)](https://github.com/starfalling "starfalling (12 commits)")[![qiyuewuyi](https://avatars.githubusercontent.com/u/16025464?v=4)](https://github.com/qiyuewuyi "qiyuewuyi (5 commits)")[![genius4339](https://avatars.githubusercontent.com/u/4507289?v=4)](https://github.com/genius4339 "genius4339 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/starfalling-aliyun-tablestore-php-sdk/health.svg)

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

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k511.3M2.2k](/packages/aws-aws-sdk-php)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M78](/packages/google-cloud-core)[google/gax

Google API Core for PHP

263103.1M451](/packages/google-gax)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M340](/packages/drupal-core-recommended)

PHPackages © 2026

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