SSL certificate error: unable to get local issuer

2019-09-06 18:55发布

I am trying to use the Podio API for the first time, and am trying to run the Hello World script on this page, but I keep getting this error: enter image description here

Here is my code:

<?php
require_once './vendor/podio/podio-php/PodioAPI.php';

$client_id = "<my_id>";
$client_secret = "<my_secret>";
$app_id = "<my_app_id>";
$app_token = "<my_app_token>";

Podio::setup($client_id, $client_secret);
Podio::authenticate_with_app($app_id, $app_token);
$items = PodioItem::filter($app_id);

print "My app has ".count($items)." items";
?>

When I comment out the last three lines and just run this:

<?php
require_once './vendor/podio/podio-php/PodioAPI.php';

$client_id = "<my_id>";
$client_secret = "<my_secret>";
$app_id = "<my_app_id>";
$app_token = "<my_app_token>";

Podio::setup($client_id, $client_secret);

?>

The code runs without errors, So that leads me to believe that it is a problem with the app token, but I got the app token by following these instructions

What is wrong here?

When I got my api key, I put in a fake url, because I am running this test my computer. Could that be the issue?

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-09-06 19:04

I solved this by downloading cacert.pem from this site https://curl.haxx.se/docs/caextract.html into my C:\xampp\php directory. I then uncommented/edited these lines in my php.ini file

curl.cainfo = "C:\xampp\php\cacert.pem" 
openssl.cafile="C:\xampp\php\cacert.pem"
查看更多
登录 后发表回答