Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL error 60 #843

Closed
amitsadana444 opened this Issue Feb 10, 2016 · 19 comments

Comments

Projects
None yet
@amitsadana444
Copy link

amitsadana444 commented Feb 10, 2016

Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in D:\bin\xampp\htdocs\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 D:\bin\xampp\htdocs\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 D:\bin\xampp\htdocs\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 D:\bin\xampp\htdocs\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleH in D:\bin\xampp\htdocs\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

What is this problem?
How can I solve this?
I checked a lot of links related with this, but no result.
Please help me all.
Thanks for your time.

@bshaffer

This comment has been minimized.

Copy link
Contributor

bshaffer commented Feb 10, 2016

Hmm, at a glance this seems like an underlying curl problem, or even an underlying Guzzle problem, and not an issue with this library.

@bshaffer

This comment has been minimized.

Copy link
Contributor

bshaffer commented Feb 11, 2016

This stack overflow provides several ways to work around this problem.

@bshaffer bshaffer closed this Feb 11, 2016

@sarasad

This comment has been minimized.

Copy link

sarasad commented Jan 9, 2017

hii ,
i'm having the same problem , how did u slove it please
help

@bshaffer

This comment has been minimized.

Copy link
Contributor

bshaffer commented Jan 9, 2017

  • Save the following to cacert.pem: https://curl.haxx.se/ca/cacert.pem

  • put it here:

    C:\xampp\php\extras\ssl\cacert.pem

  • in your php.ini put this line in this section:

    ;;;;;;;;;;;;;;;;;;;;
    ; php.ini Options  ;
    ;;;;;;;;;;;;;;;;;;;;
    
    curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
    
  • restart your webserver/apache

@sarasad

This comment has been minimized.

Copy link

sarasad commented Jan 9, 2017

Thank youu ,
i did that but still not working :(

@bshaffer

This comment has been minimized.

Copy link
Contributor

bshaffer commented Jan 9, 2017

@sarasad it's possible you added it to the wrong php.ini or did not properly restart your web server. Add a file such as this and ensure the curl.cainfo value is as expected:

<?php
// somefile.php

phpinfo();

If that doesn't work, try seeing the guzzle documentation on how to provide your own cert file directly (guzzle/guzzle#394). For this library, it will look something like this:

$http = new GuzzleHttp\Client([
    'verify' => '/path/to/cert.pem'
];
$google = new Google_Client;
$google->setHttpClient($http);
@sarasad

This comment has been minimized.

Copy link

sarasad commented Jan 9, 2017

Thank you so much for replying
but still same problem :(
this is the msg i gt exactly :
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\api-samples-master\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:188 Stack trace: #0 C:\xampp\htdocs\api-samples-master\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(151): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\htdocs\api-samples-master\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(104): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\htdocs\api-samples-master\php\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\ in C:\xampp\htdocs\api-samples-master\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 188

@aingelc12ell

This comment has been minimized.

Copy link

aingelc12ell commented Feb 7, 2017

Looks like this problem occurs from a local location (like your workstation).

Had the same problem.
However, when I uploaded and ran it on my webserver, it works.

Same thing, I'd like to know how to resolve it, running from my machine.

@cylosh

This comment has been minimized.

Copy link

cylosh commented Mar 16, 2017

put 'verify' => false

@df257

This comment has been minimized.

Copy link

df257 commented Mar 17, 2017

I have same problem! Can you tell me how solve it? @amitsadana444
curl.cainfo = "xxx\cacert.pem" it not work
I modify php.ini in xxx/apache/bin

@ATXcoder

This comment has been minimized.

Copy link

ATXcoder commented Mar 18, 2017

I have WAMP running on my Windows box and was able to solve this issue following @bshaffer instructions but with some minor adjustments. One thing to keep in mind at least if you are running WAMP (not sure if the same applies to LAMP) is that WAMP may be using two different versions of PHP (for me it was version 5 & 7). It uses version 5 for the command line and version 7 for web apps. Here's how I fixed mine:

  1. Placing the cacert.perm from https://curl.haxx.se/ca/cacert.pem in the correct folder. In my case it was "C:\wamp\bin\php\php5.6.19\extras\ssl".

  2. Modify php.ini, found in folder "C:\Wamp\bin\php\php5.6.19". Find the following section
    ;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;;
    and add the following line to that section (modify the folder path to match where you placed the cacert.pem file):
    curl.cainfo = "C:\wamp\bin\php\php5.6.19\extras\ssl\cacert.pem"

  3. Save the file

  4. Restart PHP (I just click in the WAMP icon in the system tray and click on "Restart All Services"

You should then be able to run the Google Calendar API Quickstart example.

@Stankim

This comment has been minimized.

Copy link

Stankim commented May 28, 2017

Thank you bshaffer. Worked for me. Using xampp in windows

@Hujjat

This comment has been minimized.

Copy link

Hujjat commented Jun 5, 2017

@ATXcoder did not work on wamp. I still get the same errors.

@basitmakine

This comment has been minimized.

Copy link

basitmakine commented Jun 20, 2017

@bshaffer Adding cacert.pem did the trick for me on XAMPP Windows. Thanks!

@tallrye tallrye referenced this issue Jun 30, 2017

Closed

curl error 60 #193

@abdul202

This comment has been minimized.

Copy link

abdul202 commented Dec 27, 2017

i have another apprrocahe it works for me
open vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php

and change thsi

$conf[CURLOPT_SSL_VERIFYHOST] = 2;
                $conf[CURLOPT_SSL_VERIFYPEER] = true;

to this

              $conf[CURLOPT_SSL_VERIFYHOST] = 0;
                $conf[CURLOPT_SSL_VERIFYPEER] = FALSE;

it's a temporary solution if you upated this file the changes will lost

@Mohd-Hasan

This comment has been minimized.

Copy link

Mohd-Hasan commented Jul 3, 2018

thanks @abdul202 it is working

@brsvrgn

This comment has been minimized.

Copy link

brsvrgn commented Aug 22, 2018

thanks @abdul202 also worked for me.

@TomixChiu

This comment has been minimized.

Copy link

TomixChiu commented Jan 1, 2019

  • Save the following to cacert.pem: https://curl.haxx.se/ca/cacert.pem
  • put it here:

    C:\xampp\php\extras\ssl\cacert.pem

  • in your php.ini put this line in this section:
    ;;;;;;;;;;;;;;;;;;;;
    ; php.ini Options  ;
    ;;;;;;;;;;;;;;;;;;;;
    
    curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
    
  • restart your webserver/apache

I follw your steps, and solve this problem, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.