9951 explained code solutions for 126 technologies


php-guzzleHow to troubleshoot cURL error 60 with Guzzle in PHP?


To troubleshoot cURL error 60 with Guzzle in PHP, you can use the following code snippet:

try {
    $client = new GuzzleHttp\Client();
    $res = $client->request('GET', 'https://example.com');
    echo $res->getStatusCode();
} catch (GuzzleHttp\Exception\RequestException $e) {
    echo $e->getMessage();
}

The output of the above code will be the error message associated with the cURL error 60.

Things to check when getting this error

  • Check the URL you are trying to access is valid and reachable.
  • Check the SSL certificate of the URL is valid and up-to-date.
  • Check the cURL version you are using is up-to-date.
  • Check the Guzzle version you are using is up-to-date.

Helpful links

Edit this code on GitHub