'cURL error 60: See http://curl.haxx.se/libcurl/c/libcurl-errors.html

Hi I am trying to fetch profile data using the google+ rest API but i,m getting this error :

Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException' with message 'cURL error 60: See http://curl.haxx.se/libcurl/c/libcurl-errors.html' in C:\wamp\www\plus3\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 51

Here is the error Screen shot.

Currently i,m working on localhost. I have tried everything which includes installing composer, curl...etc. Not sure what is it that i,m doing wrong. Why cant i fetch data from profile.

Here is the code :

   <?php

include_once __DIR__ . '/../vendor/autoload.php';
include_once "templates/base.php";

  session_start();

$client = new Google_Client();


  $client = new Google_Client();
    $client->setApplicationName("Google+ PHP Starter Application");

    // credentials are intentionally not disclosed but they are correct. 
     $client->setClientId('XXXXXX');
     $client->setClientSecret('XXXXXXX');
     $client->setRedirectUri('http://localhost/....');
     $client->setDeveloperKey('XXXXX');

    $plus = new Google_Service_Plus($client);

//Everything works fine before this line...as soon as i write the line
//below to fetch results with name brett...it throws me an error.

    $results = $plus->people->search('brett');

    ?>
  <!doctype html>
    <html>
    <head><link rel='stylesheet' href='style.css' /></head>
    <body>
    <header><h1>Google+ Sample App</h1></header>
    </body>
    </html>


Solution 1:[1]

A little late maybe, but for anyone strolling around these pages in the future:

Check your php.ini file for the option 'curl.cainfo'. Specify the absolute path to the certificate (which you can download at: http://curl.haxx.se/ca/cacert.pem). Activate the option by removing the semicolon at the start of the line. Reboot the Apache server and you should be fine.

Solution 2:[2]

If your operating system has centos or a Fedora, must allowed Httpd_can_network_connect connection. by default all access httpd(nginx-apache-...) are disable.


setsebool httpd_can_network_connect 1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hugo Wijdeveld
Solution 2 dinobi