未捕获的GuzzleHttp\Exception\RequestException:php中的cURL错误60



我试图通过phpapi获取数据,但在我的wampp服务器中收到以下错误消息

Fatal error: Uncaught GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/
GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/ in C:wamp64wwwopenseavendorguzzlehttpguzzlesrcHandlerCurlFactory.php on line 211

这是我的代码,它给了我错误,我如何才能解决这个问题

require_once('vendor/autoload.php');
$client = new GuzzleHttpClient();
$response = $client->request('GET', 'https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/');
echo $response->getBody();

这是因为SSL证书,请尝试此选项:

$client  = new GuzzleHttpClient( [ 'curl' => [CURLOPT_SSL_VERIFYPEER => false ] ] );

最新更新