2

I'm stuck with building a Google login page without composer.

What i have so far is:

require_once   'google-api-php-client-1-master/src/Google/autoload.php';

define('GOOGLE_CLIENT_ID', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
define('GOOGLE_CLIENT_SECRET', 'xxxxxxxxxxxxxxxxxxxxxxxx');
define('GOOGLE_REDIRECT_URL', 'https://url to page after login');

$gClient = new Google_Client();
$gClient->setApplicationName('Inlog PROJECTNAME');
$gClient->setClientId(GOOGLE_CLIENT_ID);
$gClient->setClientSecret(GOOGLE_CLIENT_SECRET);
$gClient->setRedirectUri(GOOGLE_REDIRECT_URL);

$google_oauthV2 = new Google_Oauth2Service($gClient);

I downloaded this library from Github and included it as above, i saw this error:

Fatal error: Uncaught Error: Class 'Google_Oauth2Service' not found in /home/xxxxxxx/domain/xxxxxxxx/public_html/includes/google-login.config.php:46 Stack trace: #0 /home/xxxxxxx/domains/xxxxxxxxxx/public_html/google-login.php(5): require_once() #1 {main} thrown in /home/xxxxxxx/domains/xxxxxxxxxxx/public_html/includes/google-login.config.php on line 46

How can i fix this without the use off composer?? Thanks in advance!!

Dave
  • 27
  • 7

0 Answers0