close

[Solved] cURL error 77: error setting certificate verify locations: CAfile

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error cURL error 77: error setting certificate verify locations: CAfilev in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How cURL error 77: error setting certificate verify locations: CAfile Error Occurs?

Today I get the following error cURL error 77: error setting certificate verify locations: CAfilev in php.

How To Solve cURL error 77: error setting certificate verify locations: CAfile Error ?

  1. How To Solve cURL error 77: error setting certificate verify locations: CAfile Error ?

    To Solve cURL error 77: error setting certificate verify locations: CAfile Error I already set openssl.cafile so it was not throwing error for that but oepnssl.capath was not set sot error was there.

  2. cURL error 77: error setting certificate verify locations: CAfile

    To Solve cURL error 77: error setting certificate verify locations: CAfile Error I already set openssl.cafile so it was not throwing error for that but oepnssl.capath was not set sot error was there.

Solution 1

This same problem with me in php version 8.0.3 on windows : Solution was I had to uncomment and set openssl.capath=path of certs in php.ini file.

I already set openssl.cafile so it was not throwing error for that but oepnssl.capath was not set sot error was there.

openssl.cafile=”C:\Users\Akta\Softwares\php-8.0.3-nts-Win32-vs16-x64\extras\ssl\demoCA\cacert.pem”

openssl.capath=”C:\Users\Akta\Softwares\php-8.0.3-nts-Win32-vs16-x64\extras\ssl\demoCA\certs”

Solution 2

In your php.ini file, you should also update your

;openssl.cafile 

with the same cacert.pem link you used in updating your

;curl.cainfo

Have a look at mine before and after

;curl.cainfo =

;openssl.cafile=

to

curl.cainfo ="C:\php-7.4.11\extras\ssl\cacert.pem"

openssl.cafile="C:\php-7.4.11\extras\ssl\cacert.pem"

curl.cainfo =”C:\php-7.4.11\extras\ssl\cacert.pem” this fixes the cURL 60 error while openssl.cafile=”C:\php-7.4.11\extras\ssl\cacert.pem” fixes the cURL 77 error.

Have fun!

NB: Do not forget to restart your server before trying it out.

For those who wish to find their php.ini file, use this command after you cd into your application

php -i | grep 'Configuration File'

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment