Google API throwing error when verifying token

时间秒杀一切 提交于 2020-01-15 09:52:22

问题


I've been trying to use the Google-API for Google Sign-In, but when I do

// $token is set to a correct value beforehand
require_once 'inc/google-api/vendor/autoload.php';
$client = new Google_Client(['client_id' => '280452639491-s53psco36kn5cm3nitma4gpqsq9ik3ao.apps.googleusercontent.com']);
$payload = $client->verifyIdToken($token);

as instructed by google, this error pops up:

Fatal error: Uncaught exception 'RuntimeException' with message 
'Guzzle requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.'

My Website is hosted on bplaced, which uses php 5.5.21 and I downloaded the google-api-php54 package from https://github.com/google/google-api-php-client/releases, which I required as seen above.

来源:https://stackoverflow.com/questions/43299560/google-api-throwing-error-when-verifying-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!