So I need to use the Twitter REST API in a web application I'm developing and I have written some very basic PHP code to just test whether or not I can connect to the Twitter Server. Unfortunately, whenever I try to execute the code, it crops up with an error:
Fatal error: Uncaught exception 'Exception' with message 'SSL certificate problem: unable to get local issuer certificate'
I am hosting the application currently on XAMPP 3.2.2 as a testing front so it's not officially hosted anywhere as of yet.
Here is my code with the exception of my consumer key and oauth token as they're confidential:
<?php
require_once("TwitterAPIExchange.php");
$url = "https://api.twitter.com/1.1/search/tweets.json";
$twitter = new TwitterAPIExchange($settings);
$requestMethod = "GET";
$getField = "?q=twitter";
$response = $twitter->setGetfield($getField)->buildOauth($url, $requestMethod)->performRequest();
echo $response;
?>
How can I solve the SSL certificate problem? I'm not very knowledgeable about SSL and I need it to use this API in my web app.
As I've said before, I have entered my oauth and consumer details but not here as that's private information
Thanks in advance