2016-01-09 166 views
0

您好我正在嘗試使用google + rest API獲取配置文件數據,但是,我得到此錯誤:cURL錯誤60:請參閱http://curl.haxx.se/libcurl/c/libcurl-errors.html

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是錯誤屏幕截圖。

目前,我在本地主機上工作。我已經嘗試了所有包括 安裝composer,curl等等的東西。不知道是什麼,我做錯了。爲什麼不能從配置文件中獲取數據。

下面是代碼:

<?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> 
+0

你看錯了嗎? – TZHX

+0

我做了...我認爲它與捲曲有關...我確實安裝了它...有無論如何我可以仔細檢查? –

回答

0

有點晚了可能,但任何人在未來圍繞這些網頁散步:

檢查你的php.ini文件「curl.cainfo」選項。指定證書的絕對路徑(可以從此處下載:http://curl.haxx.se/ca/cacert.pem)。 通過刪除行首的分號來激活該選項。重啓Apache服務器,你應該沒問題。

+0

嗨,你能告訴我如何將它安裝在我的家園 –

+0

嗨Tuhin,不幸我不熟悉宅基地。話說回來;我的回答並不涉及「安裝」任何東西。只需激活一個默認已禁用的選項。無論如何,祝你好運! –

相關問題