sign in with Google Account in php , notes

 sign in with Google Account in php , notes


Error :   Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\coretechtive\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 67

Solution : 

The problem is in PHP 7.2 the parameter for count() can't be NULL. The warning gets displayed when $this->handles equals NULL. Just replace line 67 in CurlFactory.php with the following:

if (($this->handles ? count($this->handles) : 0) >= $this->maxHandles) {

Error :
Notice: Undefined index: expires_in in C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\Client.php on line 470

Solution  : 
    $expired = ($created
      + ($this->token['expires_in'] - 30)) < time();

replace above with  below :

$expired = ($created) < time();


Error :

Fatal error: Uncaught TypeError: Argument 1 passed to Google_AccessToken_Revoke::revokeToken() must be of the type array, null given, called in C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\Client.php on line 671 and defined in C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\AccessToken\Revoke.php:51 Stack trace: #0 C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\Client.php(671): Google_AccessToken_Revoke->revokeToken(NULL) #1 C:\xampp\htdocs\coretechtive\logout.php(8): Google_Client->revokeToken() #2 {main} thrown in C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\AccessToken\Revoke.php on line 51

solution :
C:\xampp\htdocs\coretechtive\vendor\google\apiclient\src\Google\AccessToken\Revoke.php on line 51
in this file :

public function revokeToken(array $token)

replace above code with  below :

public function revokeToken($token)








Comments