【已解决】composer安装的腾讯云sdk webman框架 vendor没有自动加载,请教怎么设置?

李天宇

问题描述

composer安装的腾讯云sdk vendor没有自动加载,试了网上几种方式没有成功

程序代码

<?php

namespace app\controller;

use TencentCloud\Common\Credential;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Ims\V20201229\ImsClient;
use TencentCloud\Ims\V20201229\Models\ImageModerationRequest;
use TencentCloud\Tms\V20201229\TmsClient;
use TencentCloud\Tms\V20201229\Models\TextModerationRequest;

报错信息

Error: Class 'TencentCloud\Common\Credential' not found in /www/wwwroot/syadmin/apiweb/app/controller/TencentCloudContent.php:74<br />

使用的是webman框架

784 2 0
2个回答

powerbowen

这个是需要你在composer里引入一下就行了,我集成YII框架的时候也遇到了,然后我加了下面一段之后重新 composer update -vvvv 就好了
截图

  • 李天宇 2022-11-16

    我这样写没好使

  • powerbowen 2022-11-17

    你的composer包贴一下,我本地调试一下

  • 李天宇 2022-11-17

    我把composer 更新一下 就好使了,其他啥都没动。。。。

metal

这个报错说的是你看的文档和当前版本不一致的问题吧,现在vender找下有没有这个包

  • 李天宇 2022-11-17

    好像是版本不一致,我更新了下就好使了

年代过于久远,无法发表回答
🔝