我的小程序测试腾讯AI服务--人脸验证,我在云平台下测试没有问题,
我下PHP的接口文件(tencentcloud-sdk-php-master),放在自己的服务器根目录,代码一样,测试通不过。
<?php
require_once '/TCloudAutoLoader.php'; //这里就通不过,提示HTTP 500错误 为什么???????
echo 'test';
/**
use TencentCloud\Common\Credential;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Iai\V20180301\IaiClient;
use TencentCloud\Iai\V20180301\Models\VerifyFaceRequest;
echo 'test';
* try {
* $cred = new Credential("Axxxxxxvxsdgsdgsdc4", "jxxxxxxxxxxxxxxxxxxxxxxxxxnh");
* $httpProfile = new HttpProfile();
* $httpProfile->setEndpoint("iai.tencentcloudapi.com");
*
* $clientProfile = new ClientProfile();
* $clientProfile->setHttpProfile($httpProfile);
* $client = new IaiClient($cred, "ap-chengdu", $clientProfile);
* $req = new VerifyFaceRequest();
*
* $params = '{"Url":"http://118xxxxxxxxxxxxx052.jpg","PersonId":"136xxxxxx52"}';
* $req->fromJsonString($params);
* $resp = $client->VerifyFace($req);
* print_r($resp->toJsonString());
* }
* catch(TencentCloudSDKException $e) {
* echo $e;
* }
*/
php7没问题的飘过