GuzzleHttp 问题汇总

===============================安装composer =====================================
1.下载 composer.phar 可执行文件。
D:\phpstudy\WWW\oc02.cc\lin2>curl -sS https://getcomposer.org/installer | php
2.直接新建composer.json,写入
{
"require": {
"guzzlehttp/guzzle": "6.5"
}
}
3.安装:
D:\phpstudy\WWW\oc02.cc\lin2>php composer.phar require guzzlehttp/guzzle:^6.5
=============================================================================================================================

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)

D:\phpstudy\WWW\oc02.cc\lin2\vendor\guzzlehttp\guzzle\src\Client.php

private function configureDefaults(array $config)
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true, //这边改为false就行
'cookies' => false
];
=============================================================================================================================
posted @ 2022-10-15 23:06  也许明天  阅读(294)  评论(0编辑  收藏  举报