【问题标题】:Uncaught GuzzleHttp\Exception\RequestException: cURL error 60 in php [duplicate]未捕获的 GuzzleHttp\Exception\RequestException:php 中的 cURL 错误 60 [重复]
【发布时间】:2022-01-24 12:22:07
【问题描述】:

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

Fatal error: Uncaught GuzzleHttp\Exception\RequestException: 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/

GuzzleHttp\Exception\RequestException: 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:\wamp64\www\opensea\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 211

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

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

【问题讨论】:

    标签: php curl wamp


    【解决方案1】:

    这是因为 SSL 证书,试试这个选项:

    $client  = new \GuzzleHttp\Client( [ 'curl' => [CURLOPT_SSL_VERIFYPEER => false ] ] );
    

    【讨论】:

      猜你喜欢
      • 2017-07-24
      • 2021-02-20
      • 1970-01-01
      • 2016-03-19
      • 2021-02-06
      • 2018-07-01
      • 2017-02-13
      • 1970-01-01
      • 2015-05-05
      相关资源
      最近更新 更多