【发布时间】:2016-04-14 06:41:18
【问题描述】:
您好,我正在尝试使用 google+ rest API 获取个人资料数据,但我收到此错误:
致命错误:未捕获的异常 'GuzzleHttp\Ring\Exception\RingException' 带有消息 'cURL 错误 60:请参阅 C:\wamp\www\plus3\vendor\guzzlehttp\guzzle\src\Exception\RequestException 中的 http://curl.haxx.se/libcurl/c/libcurl-errors.html' .php 在第 51 行
Here 是错误截图。
目前我正在本地主机上工作。我已经尝试了一切,包括 安装作曲家,卷曲...等。 不知道我做错了什么。为什么我无法从个人资料中获取数据。
代码如下:
<?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>
【问题讨论】:
-
你看错了吗?
-
我做了...我认为它与 curl 有关...我确实安装了它...无论如何我可以仔细检查一下吗?
标签: php api rest google-plus