A web app using the PHP Google API now returns a PHP Fatal error.

Asked 2 years ago, Updated 2 years ago, 66 views

A web application using Google API developed at the end of 2017 and running from January to March this year is
Suddenly, a PHP Fatal error was returned.
Client displays 500 - Internal Server Error.
The following error occurs when operating on the server side.

PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Error creating resource:
[message] fopen():SSL operation failed with code 1.OpenSSL Error messages:error:14090086:SSL routes:ssl3_get_server_certificate:certificate verify failed
[file] D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php 
[line] 287
message fopen()—Failed to enable crypto
[file] D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php 
[line] 287
[message] fopen(https://www.googleapis.com/oauth2/v4/token):failed to open stream:operation failed
[file] D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php 
[line] 287'in
D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php:227 Stack trace:#0
D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php(291):GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure))#1 
D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php(52):GuzzleHttp\Handler\StreamHandler->createStreamin 
D:\inetpub\ogads\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line51 

The source being generated is
"First Analytics API: PHP Quick Start for Web Applications"
https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/web-php?hl=ja
The same error occurred when I tried index.php/oauth2callback.php in .
The source of the above URL is the source I used to create the web app.

Is it a server environment because the source is unmodified/tutorial source also occurs?
As far as the error is concerned, it appears that Google files are denying SSL authentication.
I'm at a loss. If anyone knows, please let me know.

php ssl

2022-09-30 11:12

1 Answers

I solved myself.Due to PHP's OPEN_SSL relationship, I added opensl.cafile and opensl.capath in PHP.INI, and opensl.cafile in curl, but the error disappeared.


2022-09-30 11:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.