我創建一個組件:類「Google_Client」未找到
<?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
}
}
}
及其對當地工作正常,但現場服務器上我得到以下錯誤:
消息「:」類「 Google_Client」未找到」,
會有什麼問題?
您是否安裝了所需的(composer)軟件包? – Jerodev
你是否需要作曲家autoload.php? – modsfabio
是的,我已經上傳所有供應商的文件和文件夾 – Arunendra