PHPackages                             sabercoding/php-ots - 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. [API Development](/categories/api)
4. /
5. sabercoding/php-ots

AbandonedLibrary[API Development](/categories/api)

sabercoding/php-ots
===================

Aliyun OTS SDK for PHP

v4(7y ago)0201PHP &gt;=5.5

Since Dec 16Compare

[ Source](https://github.com/sabercoding/php-ots)[ Packagist](https://packagist.org/packages/sabercoding/php-ots)[ Docs](http://www.aliyun.com/product/ots)[ RSS](/packages/sabercoding-php-ots/feed)WikiDiscussions Synced yesterday

READMEChangelogDependencies (6)Versions (4)Used By (1)

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

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

说明
==

[](#说明)

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)

composer包。。。

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

2856d ago

PHP version history (2 changes)v0.1PHP &gt;=5.3

v4PHP &gt;=5.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5622758?v=4)[saber](/maintainers/sabercoding)[@sabercoding](https://github.com/sabercoding)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sabercoding-php-ots/health.svg)

```
[![Health](https://phpackages.com/badges/sabercoding-php-ots/health.svg)](https://phpackages.com/packages/sabercoding-php-ots)
```

###  Alternatives

[aws/aws-sdk-php

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

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[google/gax

Google API Core for PHP

268111.6M519](/packages/google-gax)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[drupal/core-recommended

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

6941.5M398](/packages/drupal-core-recommended)[google/cloud-core

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

344128.8M106](/packages/google-cloud-core)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.4M25](/packages/googleads-googleads-php-lib)

PHPackages © 2026

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