PHP code example of aliyun / aliyun-tablestore-sdk-php

1. Go to this page and download the library: Download aliyun/aliyun-tablestore-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aliyun / aliyun-tablestore-sdk-php example snippets


    


Aliyun\OTS\OTSClient;

$client = new OTSClient([
    'EndPoint' => 'https://your-instance.cn-hangzhou.ots.aliyuncs.com',
    'AccessKeyID' => 'your-access-key-id',
    'AccessKeySecret' => 'your-access-key-secret',
    'InstanceName' => 'your-instance-name',
]);

// 列出所有表
$tables = $client->listTable([]);
print_r($tables);
ini
; 设置时区
date.timezone = Asia/Shanghai

; 建议将内存限制设置为 512M 或更高(GetRange 等接口可能占用较多内存)
memory_limit = 512M
bash
   php examples/PKAutoIncrment.php
   
bash
   php vendor/bin/phpunit