Laravel 5 Socialite - cURL error 77: error setting

2019-01-17 11:24发布

I am using socialite in Laravel 5 to setup facebook login. I followed the instructions carefully until I got stuck with the following error

cURL error 60: SSL certificate problem: unable to get local issuer certificate

so I found the this answer to fix it which indeed passed but then I got this error

cURL error 77: error setting certificate verify locations:
CAfile: /Applications/XAMPP/xamppfiles/cacert.pem
CApath: none

Any ideas what's the cause of this error?! and how to fix it?!

15条回答
Root(大扎)
2楼-- · 2019-01-17 12:00

For windows

I had same problem after i updated php on window 2008. Suddenly all my php codes stopped working. What i did, i opned php.ini then i found a line

;curl.cainfo =

and i changed to

curl.cainfo = "C:\Program Files (x86)\PHP\v7.0\cacert.pem" (remember to remove ; before curl.cainfo)

and everything went to normal. What you need is to download a cert file cert.pem and place it anywhere on your server and change the line as i did in php.ini

查看更多
叼着烟拽天下
3楼-- · 2019-01-17 12:00

I've tried @mahesh-singh-chouhan, @omarsafwany, @LyleK solutions. but get same error repeatedly.

After that, I update php.ini file without double quotes & with .pem extension & I'm succeed to get desired result with below code.

curl.cainfo=E:\Xampp-5.6.3\php\ext\cacert.pem

I've also attached Screenshot.

Please first try above users suggestions, If failed also use this.

Thanks for solutions It creates way for me @mahesh-singh-chouhan, @omarsafwany, @LyleK [![enter image description here][1]][1]

  [1]: https://i.stack.imgur.com/3Pgkp.jpg
查看更多
smile是对你的礼貌
4楼-- · 2019-01-17 12:01
  1. Save this certificate (https://curl.haxx.se/ca/cacert.pem) as cacert.pem.txt in C:\xampp\php
  2. Add to php.ini:

    curl.cainfo = "C:\xampp\php\cacert.pem.txt"
    
  3. Don't forget to restart XAMPP (it won't work until it restarts)

Then it works fine!

查看更多
贼婆χ
5楼-- · 2019-01-17 12:02

If it is related to git
git config --global http.sslverify "false" will solve the problem

查看更多
霸刀☆藐视天下
6楼-- · 2019-01-17 12:03

You need to replace the existing certificate with the other one here. After that:

  • Extract and add it to xampp\php\ext
  • Open xampp\php\php.ini
  • Add this line curl.cainfo='location from the first step' to the end of the file.
  • Restart and it should be working now.

This is the source link.

查看更多
男人必须洒脱
7楼-- · 2019-01-17 12:05

Add cacert.pem file from https://curl.haxx.se/ca/cacert.pem in c:\xampp\php\cacert.pem

Change setting in php.ini file:

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

查看更多
登录 后发表回答