Good morning,
I work locally on Wampserver and I want to access an API locally.
So it gives me this error:
( ! ) Fatal error: Uncaught GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.themoviedb.org/3/movie/now_playing?language=fr-FR&page=1®ion=FR in C:wamp64wwwsitesmon-sitelibraryvendorguzzlehttpguzzlesrcHandlerCurlFactory.php on line 211 |
---|
( ! ) GuzzleHttpExceptionRequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.themoviedb.org/3/movie/now_playing?language=fr-FR&page=1®ion=FR in C:wamp64wwwsitesmon-sitelibraryvendorguzzlehttpguzzlesrcHandlerCurlFactory.php on line 211 |
Call Stack |
# | Time | Memory | Function | Location |
---|---|---|---|---|
1 | 0.0006 | 364568 | {main}( ) | …API-now_playing.php:0 |
2 | 0.0041 | 375984 | GuzzleHttpClient->request( $method = ‘GET’, $uri = ‘https://api.themoviedb.org/3/movie/now_playing?language=fr-FR&page=1®ion=FR’, $options = [‘headers’ => [‘Authorization’ => ‘Bearer ey[…]HU’, ‘accept’ => ‘application/json’]] ) | …API-now_playing.php:7 |
3 | 0.1871 | 414024 | GuzzleHttpPromiseRejectedPromise->wait( $unwrap = ??? ) | …Client.php:189 |
I therefore understood that the error comes from the fact that locally I do not have an SSL certificate.
What can I do to fix this error?
Is it possible to install a certificate locally? If yes, how to proceed?
Thank you for your time and your response.
I have this code below which works on server but not locally.“`php
<?php
require_once('../../library/vendor/autoload.php');
$client = new GuzzleHttpClient();
$response = $client->request('GET', 'https://api.themoviedb.org/3/movie/now_playing?language=fr-FR&page=1®ion=FR', [
'headers' => [
'Authorization' => 'Bearer ey[...]HU',
'accept' => 'application/json',
],
]);
$rep = $response->getBody();
echo $rep;
?>
2
Answers
Thank you for your reply.
But no solution works. The first returns:
The second returns:
Do you have another solution?
EDIT : I'm sorry It's good !
The final code:
Thank you for your reply !
If you work locally you can just disable ssl verification inside your request. I hope one of these should work.
Or