Laravel 5 Socialite - cURL错误77:错误设置证书验证位置

oma*_*any 25 php ssl curl laravel-5 laravel-socialite

我在Laravel 5中使用社交名流设置Facebook登录.我仔细按照说明操作,直到遇到以下错误

cURL error 60: SSL certificate problem: unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)

所以我找到了这个答案来修复它确实通过但后来我得到了这个错误

cURL error 77: error setting certificate verify locations:
CAfile: /Applications/XAMPP/xamppfiles/cacert.pem
CApath: none
Run Code Online (Sandbox Code Playgroud)

任何想法是什么原因造成这个错误?!以及如何解决它?!

Lyl*_*leK 29

我也遇到了这个问题.事实证明,我的php.ini文件中的证书设置路径不正确.忘记.txt扩展名.

我有什么:

curl.cainfo = "C:\xampp\php\cacert.pem"
Run Code Online (Sandbox Code Playgroud)

我把它改成了:

curl.cainfo = "C:\xampp\php\cacert.pem.txt"
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助.


小智 21

从c:\ xampp\php\cacert.pem中的https://curl.haxx.se/ca/cacert.pem添加cacert.pem文件

更改php.ini文件中的设置:

curl.cainfo ="C:\ xampp\php\cacert.pem


Sam*_*ian 13

我的错误是:

cURL错误77:错误设置证书验证位置:CAfile:C:\ xampp \ apache \ bin \ curl-ca-bundle.crt CApath:无(请参阅 http://curl.haxx.se/libcurl/c/libcurl-errors .html


这对我来说很好:

  1. 从以下位置下载证书:https : //curl.haxx.se/ca/cacert.pem
  2. cacert.pem文件重命名为curl-ca-bundle.crt
  3. 将文件复制到path / to / xampp / apache / bin
  4. 重新启动Apache

  • 谢谢。“重命名”挽救了我的生活。上帝祝福你 (2认同)

小智 9

  1. 保存此证书(https://curl.haxx.se/ca/cacert.pem)为cacert.pem.txtC:\xampp\php
  2. 添加到php.ini:

    curl.cainfo = "C:\xampp\php\cacert.pem.txt"
    
    Run Code Online (Sandbox Code Playgroud)
  3. 不要忘记重启XAMPP(重启后才能工作)

然后它工作正常!


小智 6

检查 php.ini 文件上的双引号:\n如果您从 Web 复制并过去,可能您得到了错误的双引号:

\n\n
\n

\xe2\x80\x9dC:\\xampp\\php\\cacert.pem.txt\xe2\x80\x9d

\n
\n\n

代替

\n\n
\n

“C:\\ xampp \\ php \\ cacert.pem.txt”

\n
\n


Fel*_*too 6

  1. 从(https://curl.haxx.se/ca/cacert.pem)下载
  2. 将名称“ cacert.pem ”更改为“ curl-ca-bundle.crt
  3. 在' php.ini '中,删除' ; ' 在以下行中: curl.cainfo="C:\xampp\apache\bin\curl-ca-bundle.crt"

这对我有用。


Cha*_*hur 6

按照有关错误 77 的说明,我遇到了一些问题。

在 Windows 7 上,根据您的安全设置 - 下载的文件可能会被阻止。看截图:

Windows 7 文件属性

一旦我取消阻止文件并确保正确的用户访问权限,我还必须将文件放在以下位置:

C:\xampp\apache\bin\cacert.pem.txt

除了根据有关此问题的其他帖子更改 php.ini 之外。

curl.cainfo="C:\xampp\php\cacert.pem.txt"

完成上述步骤后,通过 XAMPP 控制面板重新启动 Apache,错误已解决。