注:mac中自带的curl和php版本可能不兼容,或者其他原因,在未安装curl时总是无法调用https,提示SSL certificate problem: Invalid certificate chain
操作流程
# 安装php
# Include Curl support via Homebrew
brew install php70 --with-homebrew-curl
# 通过brew 安装curl
# Build with OpenSSL instead of Secure Transport
brew install curl --with-openssl
说明
OpenSSL
OpenSSL 是一个安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用
遇到问题
checking if the location of ZLIB install directory is defined... no
configure: error: Cannot find libz
解决:
xcode-select --install

本文介绍了在Mac环境中解决PHP与curl不兼容的问题,通过Homebrew安装特定版本的PHP和带有OpenSSL支持的curl,确保HTTPS请求正常工作。
409

被折叠的 条评论
为什么被折叠?



