阿里云SDK如何在thinkphp5里调用

admin2年前thinkphp777

composor到vendor目录后

项目内直接引用,譬如

use AlibabaCloud\SDK\Ocrapi\V20210707\Ocrapi;
use AlibabaCloud\Tea\Utils\Utils;
use AlibabaCloud\Tea\Console\Console;

use Darabonba\OpenApi\Models\Config;
use AlibabaCloud\SDK\Ocrapi\V20210707\Models\RecognizeBusinessLicenseRequest;
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
private function createClient($accessKeyId, $accessKeySecret)
    {
        $config = new Config([
            // 必填,您的 AccessKey ID
            "accessKeyId" => $accessKeyId,
            // 必填,您的 AccessKey Secret
            "accessKeySecret" => $accessKeySecret
        ]);
        // Endpoint 请参考 https://api.aliyun.com/product/ocr-api
        $config->endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
        return new Ocrapi($config);
    }


相关文章

thinkphp 项目报错No input file specified.

1提示:“No input file specified.”原因在于使用的PHP5.6是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误。默认的.htaccess里面的...

think-queue队列的实现

https://www.jianshu.com/p/f5e33215c13c...

thinkphp图片等比例缩小

$image = \think\Image::open($filename);        // 返回图片的宽度      &n...

thinkphp分页,数字页+上下页+跳转+每页数据下拉

<?php namespace Think; class Page{     public $firstRow;&...

thinkphp分页paginate获取可以foreach的数据

public function index(){    $goods_name = I('goods_name&...

tp导出excel信息

public function studentsExport(){        set_time_limit (0);     ...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。