If you are trying to get some data from an external API and it is working on the Postman or on the live server but is not working locally, and you may also face an error like:
SSL certificate problem: unable to get local issuer certificate
here is a quick solution for this issue:
- Download this file: http://curl.haxx.se/ca/cacert.pem
- Place this file in your php folder, i.e C:\wamp64\bin\php\php8.1.0
- Open php.ini and find this line:
;curl.cainfo
Change it to:
curl.cainfo = “C:\wamp64\bin\php\php8.1.0\cacert.pem“
- Make sure you remove the semicolon at the beginning of the line and double-check the path of the php folder
- Save changes to php.ini,
- Restart WampServer (or any other local server you have)