2017-11-01 3 views
-1
내가 모든 일을하지만, 몇 일 전, 오류가 발생했습니다

SSL 에러 구글 드라이브 API를

include_once ROOT.'/google-api-php-client/vendor/autoload.php'; 

$client = new Google_Client(); 

$credentialsFile = ROOT.'/google-api-php-client/service_account.json'; 
if (!file_exists($credentialsFile)) { 
    throw new RuntimeException('Service account credentials Not Found!'); 
} 

$client->setAuthConfig($credentialsFile); 
$client->setScopes(Google_Service_Drive::DRIVE); 

$service = new Google_Service_Drive($client); 

/** 
    * Проверка существования папки для документов 
    */ 

$optParams = array(
    'q' => "name='Документы'" 
); 
$results = $service->files->listFiles($optParams); 
if (count($results->getFiles()) == 0) { 
exit('Нет папки для документов'); 
} else { 
    foreach ($results->getFiles() as $file) { 
$papka_doc = $file->getId(); 
    } 
} 

파일을 검색 또는 드라이브 구글에 업로드 PHP 라이브러리를 사용하고

:

 
Uncaught exception 'GuzzleHttp\\Exception\\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) 

무엇이 문제 일 수 있습니까?

답변

0

이 시도, 첫째

, 당신은 curl.cert 파일을 다운로드해야

curl https://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt 

는 두 번째로,이 인증서를 설정합니다.

$client->getHttpClient()->setDefaultOption('verify', '[Certificate File Path]'); 

Centos 기본 경로;

+0

불행히도이 방법은 도움이되지 않았습니다. –

관련 문제