解决Mac Os Zttp / Guzzle Http 本地 curl 出错问题

环境 : 10.15+
valet dnsmasq

出现 curl 56 或者 resolve host 时执行下面这个指令

brew uninstall --ignore-dependencies curl-openssl

检测版本:
curl --version

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets

php curl 版本
php --ri curl

curl

cURL support => enabled
cURL Information => 7.65.3
Age => 4
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => No
BROTLI => Yes
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin18.6.0
SSL Version => OpenSSL/1.0.2s
ZLib Version => 1.2.11
libSSH Version => libssh2/1.9.0

Directive => Local Value => Master Value
curl.cainfo => no value => no value

一个是 7.65.3 一个是 7.64.1 两个版本有一个用的和dnsmasq 内的版本不兼容

最后重新服务
brew services restart php

最简单的方案是什么也不修改, 直接添加你要的地址到 /etc/hosts 如 127.0.0.1 test.com

你可能感兴趣的:(解决Mac Os Zttp / Guzzle Http 本地 curl 出错问题)