1. 程式人生 > >cURL error 60 錯誤解決辦法

cURL error 60 錯誤解決辦法

php在curl的時候報此錯誤:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
根據報錯後面提示的地址查詢60錯誤:
CURLE_SSL_CACERT (60)
Peer certificate cannot be authenticated with known CA certificates.

無法獲取本地頒發者證書

關於“SSL證書問題:無法獲取本地頒發者證書”錯誤。顯然,這適用於傳送CURL請求的系統(並且沒有接收請求的伺服器)

2)將以下行新增到php.ini(如果這是共享託管和您沒有訪問php.ini然後你可以新增到.user.ini在public_html)

curl.cainfo=/path/to/downloaded/cacert.pem

3)預設情況下,FastCGI程序將每隔300秒解析新檔案(如果需要,您可以通過新增幾個檔案來更改頻率,如這裡建議的https://ss88.uk/blog/fast-cgi-and-user-ini -files-the-new-htaccess /)