Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

whydvsdamitha's avatar

i have add cacert.pem file and add correct path in php.ini file. then restart xamp server but still problem not fixed please any one help me. i'm running on localhost:8000 is it problem

ryanlackey's avatar

I'm new to php and api requests, let me just say that :). My question is when testing on localhost:8000 laravel project with guzzle, none of the cacert.pem problem solving is working for me. The website api I'm hooking into just has a app_key and app_id to return json. My question is is the SSL noticed by just the "s" in https? so when I take the "S" off of https and use http, the request works. So for now I've made a constant with a blank "" and place after the http'.constant.'//url then in production I can just add the "s" to the constant and get the same result? Very new to this so just wondering.

madmax's avatar

I am integrating Woo-commerce API's in my Laravel 5.6 site using Woo-commerce official rest sdk. I made a link using authentication endpoint URL.Which is mention at here .

When user clicks the link it takes the user to Woo-commerce authentication page, where user login and Approve the request.

After approving the request it should take me to return url which i mention in the link. Instead it shows me the following error.

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

I have tried this. But it's also not working.

I put the cacert.pem in '/etc/ssl/certs' directory, also make the entry in php.ini like

curl.cainfo = "/etc/ssl/certs/cacert.pem". But it's not working after restarting the server

MotikDev's avatar

I just encountered this same issue today, if you have tried all the steps above and it is still not working. Then, check your date and time, this was the solution in my own case. Please, like if it helped you

MotikDev's avatar

@jpeterson579 I know it's late but for other people still having this same issue, it's your laptop's date and time I was referring to.

kamr's avatar

download and extract cacert.pem following the instructions at https://curl.se/docs/caextract.html

save it on your filesystem somewhere (for example, C:\php-7.3.33\extras\ssl\cacert.pem)

in your php.ini, put this file location in the [curl] section (putting it in the [openssl] section is also a good idea):

[curl] curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"

[openssl] openssl.cafile = "C:\xampp\php\extras\ssl\cacert.pem"

restart your webserver

plambkin's avatar

Step 1: Obtain a new cacert.pem file as follows

curl -sSL http://curl.haxx.se/ca/cacert.pem >> cacert.pem

Step 2: Put it somewhere

mkdir -p /usr/local/etc/openssl/certs

mv -v cacert.pem /usr/local/etc/openssl/certs

Step 3: Find the version of PHP you are using with

In your Mac OS X terminal type

Which php

/usr/local/opt/[email protected]/bin/php (this was what I was using)

I am using php 7.3

Step 4:

Open this using Sublime or another editor and go to the relevant php.ini file

/usr/local/etc/php/7.3/php.ini

Find the line marked

openssl.cafile

and add the following file location

=/usr/local/etc/openssl/certs/cacert.pem

Don’t forget to remove the semi-colon (the ;)

Exit the terminal and start it again - the problem is then resolved.

JamesSiebert's avatar

Hey :)

Just putting my solution here (MacOS) I moved from Herd to Valet and my php.ini was pointing to the herd cert and causing the curl issue.

phpinfo(); to show the php.ini file used

# /Users/james/Library/Application Support/Herd/config/php/82/php.ini
curl.cainfo=/Users/james/.config/valet/CA/LaravelValetCASelfSigned.pem
openssl.cafile=/Users/james/.config/valet/CA/LaravelValetCASelfSigned.pem
myersben9's avatar

If you have the env variable set SSL_CERT_FILE in your path and it's cert is out of date you will get this issue. Make sure to reinstall composer, select the php from herd, and update your env variable with a new cert.

shaheen_'s avatar

If you are using guzzle/http through the Http facade in laravel you can use

Http::withOptions(['verify' => false]);

also if you are using laravel version 10.42 or higher you can do the following in any service provider

Http::globalOptions(['verify' => false]);

which is global and better than using withOptions() every time you use the http facade

Previous

Please or to participate in this conversation.