Google Plus API deprecated On March 7, 2019
You can use Composer or simply Download the Release
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
composer require google/apiclient:"^2.0"
Finally, be sure to include the autoloader:
require_once '/path/to/your-project/vendor/autoload.php';
<?php
session_start();
require_once 'vendor/autoload.php';
$redirect_uri = "<Your REDIRECT URI>";
$client_id = "<Your Client ID>";
$client_secret = "<Your Client SECRET>";
$google_client = new Google_Client();
//your client id
$google_client->setClientId($client_id);
//your client secret
$google_client->setClientSecret($client_secret);
//your Redirect URI
$google_client->setRedirectUri($redirect_uri);
//scope
$google_client->setScopes("email");
$google_client->setScopes("profile");
?>