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
More of Php Guzzle
- How to use PHP Guzzle to make a batch request?
- How to set a user agent in PHP Guzzle?
- What version of PHP is required for Guzzle?
- How to use Promises with PHP Guzzle (with an example)?
- How to set a timeout for a request with PHP Guzzle?
- How to add a bearer token in PHP Guzzle?
- How to add an authorization header bearer in PHP Guzzle?
- How to update PHP Guzzle?
- How to handle a RequestException with PHP Guzzle?
See more codes...