BigQuery에서 PHP 코드의 쿼리를 실행할 수 있도록 Google BigQuery API를 구현하고 싶습니다.Google BigQuery API PHP 사용자 인증
curl https://sdk.cloud.google.com | bash
가 그럼 난 자격 증명을 작성하려면이 명령을 실행 : 나는 다음 명령하여 Google 클라우드 SDK를 설치 한
composer require google/cloud
둘째 :
우선 다음 명령으로 클라이언트 라이브러리를 설치 한 :
gcloud beta auth application-default login
모든 프로세스가 성공한 후 실행됩니다. 불행하게도 나는 메시지 오류 다음있어
# Includes the autoloader for libraries installed with composer
require __DIR__ . '/vendor/autoload.php';
# Imports the Google Cloud client library
use Google\Cloud\BigQuery\BigQueryClient;
# Your Google Cloud Platform project ID
$projectId = 'PROJECT ID';
# Instantiates a client
$bigquery = new BigQueryClient([
'projectId' => $projectId
]);
# The name for the new dataset
$datasetName = 'my_new_dataset';
# Creates the new dataset
$dataset = $bigquery->createDataset($datasetName);
echo 'Dataset ' . $dataset->id() . ' created.';
을 :하지만
Credentials saved to file:
[/home/some/my/dir/application_default_credentials.json]
These credentials will be used by any library that requests
Application Default Credentials.
가 그럼 난 PHP에이 코드를 실행하려면 : L 요청 나는 다음과 같은 메시지가
Fatal error: Uncaught exception 'Google\Cloud\Exception\ServiceException' with message 'Could not load the default credentials
그래서 내 질문에 무엇이 잘못되었으며 무엇을해야합니까?
당신
당신은 낮은 속도입니다. 중요한 점은 게시 된 답변의 왼쪽에있는 투표를 사용하여 승인 된 답변에 표시를해야한다는 것입니다. 그러면 요금이 올라갑니다. 이 링크를 방문하여 작동 방식을 확인하십시오. http://meta.stackoverflow.com/questions/5234/how-does-accepting-an-answer-work#5235 – Pentium10