Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php MAMP本地开发-cURL错误60:SSL证书:无法获取本地颁发者证书_Php_Ssl_Curl_Localhost_Mamp - Fatal编程技术网

Php MAMP本地开发-cURL错误60:SSL证书:无法获取本地颁发者证书

Php MAMP本地开发-cURL错误60:SSL证书:无法获取本地颁发者证书,php,ssl,curl,localhost,mamp,Php,Ssl,Curl,Localhost,Mamp,我使用MAMP作为本地开发环境。我想实现一个GoogleAuth,但是不断地得到这个SSL错误 正如其他SO主题所建议的,我已经在PHP.ini文件中添加了这行代码: 并从这里添加了最新的CA证书:在我的PHP SSL文件夹中:C:\MAMP\bin\PHP\php7.4.1\extras\SSL 您知道如何在本地环境中传递此SSL错误吗? 代码如下: $google_client = new \Google_Client(); $google_client->setClientI

我使用MAMP作为本地开发环境。我想实现一个GoogleAuth,但是不断地得到这个SSL错误

  • 正如其他SO主题所建议的,我已经在PHP.ini文件中添加了这行代码:
  • 并从这里添加了最新的CA证书:在我的PHP SSL文件夹中:C:\MAMP\bin\PHP\php7.4.1\extras\SSL
  • 您知道如何在本地环境中传递此SSL错误吗?

    代码如下:

    $google_client = new \Google_Client();
        $google_client->setClientId($clientID);
        $google_client->setClientSecret($clientSecret);
        $google_client->setRedirectUri($redirectUri);
        $google_client->addScope("email");
      $google_client->addScope("profile");
    
    
    
        if($this->request->getVar('code')){
            $token = $google_client->fetchAccessTokenWithAuthCode($this->request->getVar('code'));
            if(!isset($token['error'])){
                $google_client->setAccessToken($token['access_token']);
                $this->session->set('access_token', $token['access_token']);
    
                //get Google profile data
                $google_service = new \Google_Service_Oatuth2($google_client);
                $data = $google_service->userinfo->get();
                print_r($data);
    
    
    $google_client = new \Google_Client();
        $google_client->setClientId($clientID);
        $google_client->setClientSecret($clientSecret);
        $google_client->setRedirectUri($redirectUri);
        $google_client->addScope("email");
      $google_client->addScope("profile");
    
    
    
        if($this->request->getVar('code')){
            $token = $google_client->fetchAccessTokenWithAuthCode($this->request->getVar('code'));
            if(!isset($token['error'])){
                $google_client->setAccessToken($token['access_token']);
                $this->session->set('access_token', $token['access_token']);
    
                //get Google profile data
                $google_service = new \Google_Service_Oatuth2($google_client);
                $data = $google_service->userinfo->get();
                print_r($data);