October 22, 2024
Chicago 12, Melborne City, USA
PHP

Sign in with Google


// authenticate code from Google OAuth Flow

if (isset($_GET['code'])) {
    $token = $client->fetchAccessTokenWithAuthCode($_GET['code']);
    echo "yes code is there";
    $client->setAccessToken($token['access_token']);
}

Error

Warning: curl_setopt_array(): Cannot represent a stream of type Output as a STDIO FILE* in C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 57

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:67 Stack trace: #0 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(67): count(NULL) #1 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(141): GuzzleHttp\Handler\CurlFactory->release(Object(GuzzleHttp\Handler\EasyHandle)) #2 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #4 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #5 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array) #6 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php(72): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}(Object(GuzzleHttp\Psr7\Request), Array) #7 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #8 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php(68): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array) #9 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Middleware.php(59): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #10 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array) #11 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Client.php(268): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #12 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Client.php(95): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #13 C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Client.php(104): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array) #14 C:\xampp\htdocs\login_sysytems\vendor\google\auth\src\HttpHandler\Guzzle6HttpHandler.php(34): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array) #15 C:\xampp\htdocs\login_sysytems\vendor\google\auth\src\OAuth2.php(492): Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(Object(GuzzleHttp\Psr7\Request)) #16 C:\xampp\htdocs\login_sysytems\vendor\google\apiclient\src\Google\Client.php(184): Google\Auth\OAuth2->fetchAuthToken(Object(Google\Auth\HttpHandler\Guzzle6HttpHandler)) #17 C:\xampp\htdocs\login_sysytems\controller\google-login.php(7): Google_Client->fetchAccessTokenWithAuthCode(‘4/0AVG7fiSMK00n…’) #18 C:\xampp\htdocs\login_sysytems\index.php(15): include(‘C:\xampp\htdocs…’) #19 {main} thrown in C:\xampp\htdocs\login_sysytems\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 67



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video