cURL错误60:请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html [英] cURL error 60: See http://curl.haxx.se/libcurl/c/libcurl-errors.html

查看:189
本文介绍了cURL错误60:请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用google + rest API来获取个人资料数据,但是我遇到了这个错误:

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

致命错误:消息为"cURL错误60"的未捕获异常"GuzzleHttp \ Ring \ Exception \ RingException":请参见 http://curl.haxx.se/libcurl/c/libcurl-errors.html "位于C:\ wamp \ www \ plus3 \ vendor \ guzzlehttp \ guzzle \ src \ Exception \第51行的RequestException.php

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

此处是错误的屏幕截图.

目前,我正在localhost上工作.我已经尝试了一切,包括 安装作曲家,卷曲...等. 不知道我做错了什么.为什么我不能从配置文件中获取数据.

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.

这是代码:

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

推荐答案

也许有点晚了,但是对于将来在这些页面上闲逛的人来说:

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

检查php.ini文件中的'curl.cainfo'选项.指定证书的绝对路径(您可以从以下位置下载证书的绝对路径: http://curl.haxx.se /ca/cacert.pem ). 通过删除行首的分号来激活该选项.重新启动Apache服务器,就可以了.

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.

这篇关于cURL错误60:请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆