1. 程式人生 > >OSS上傳圖片時報錯:SSL certificate problem: unable to get local issuer certificate

OSS上傳圖片時報錯:SSL certificate problem: unable to get local issuer certificate

php在curl的時候報此錯誤:

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

CURLE_SSL_CACERT (60) Peer certificate cannot be authenticated with known CA certificates. 1 2 無法獲取本地頒發者證書

網上搜的解決方法:(http://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate)

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

1)從 https://curl.haxx.se/ca/cacert.pem 下載最新的cacert.pem

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 /)