2017-10-07 95 views
0

錯誤設置證書驗證地點從其他網站訪問內容:憑證檔案錯誤:/var/local/etc/ca-bundle.crt CApath:無錯誤而使用PHP和捲曲

我收到上述錯誤在訪問一個網站使用PHP的捲曲內容。我很新使用php和curl,所以無法找到解決方案。有人可以幫忙嗎?

回答

0

運行這些命令就可以解決問題:

sudo rm -rfv /var/local/etc/ca-bundle.crt 
sudo curl -o /var/local/etc/ca-bundle.crt https://curl.haxx.se/ca/cacert.pem 
sudo chmod 0444 /var/local/etc/ca-bundle.crt 

一些頁面,你可以檢查的細節:https://curl.haxx.se/docs/sslcerts.html/https://en.wikipedia.org/wiki/Certificate_authority

+0

我可以看到這個terminalPoojas-的MacBook-Pro的:〜poojadeole $ sudo的捲曲 - o /var/local/etc/ca-bundle.crt https://curl.haxx.se/ca/cacert.pem %總計%收到%Xferd平均速度時間時間時間當前 Dload上傳總花費左速度 0 0 0 0 0 0 0 0 - : - : - - : - : - - : - : - 0警告:無法創建文件/ v ar/local/etc/ca-bundle.crt:沒有這樣的文件 Warning:or directory 0 230k 0 2068 0 0 10578 0 0:00:22 - : - : - 0:00:22 10605 curl :(23)Failed writing body(0!= 2068) –

+0

對不起......但我無法準確理解/var/local/etc/ca-bundle.crt –

+0

呵呵。然後將--create-dirs添加到curl命令。 'sudo curl -o /var/local/etc/ca-bundle.crt --create-dirs https:// curl.haxx.se/ca /​​ cacert.pem' – hanshenrik