I have create a component :
<?php
namespace common\components;
use Google_Client;
use Google_Service_Gmail;
use Yii;
use yii\base\ErrorException;
use yii\helpers\ArrayHelper;
use yii\base\Component;
use yii\rest\ActiveController;
use linslin\yii2\curl;
class SocialLogin extends Component {
public $GOOGLE_CLIENT_ID;
public $FACEBOOK_CLIENT_ID;
public $GOOGLE_CLIENT_ID_IOS;
public function getGoogleUser($id_token,$device)
{
$clientID=$this->GOOGLE_CLIENT_ID;
if($device=="ios")
$clientID=$this->GOOGLE_CLIENT_ID_IOS;
$client = new Google_Client(['client_id' => $clientID]);
$payload = $client->verifyIdToken($id_token);
if ($payload) {
// my code
}
}
}
Its working fine on local but on live server i'm getting following error :
message": "Class 'Google_Client' not found",
What will be the issue ?