API request not working locally but works fine on the server

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:

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)

Leave a Reply

Your email address will not be published. Required fields are marked *