mac 在php工程中實現curl的https訪問

注: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 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章