私はFirebaseでGoogle Bigqueryをセットアップしようとしていて、問題が発生しています。私のマシン(MacOS Sierra)にgcloud
がインストールされており、私のプロジェクトで作曲家経由でグーグルクラウドがインストールされています。Bigqueryがデフォルトの資格情報を取得できませんでした
私のプロジェクトで、次のコード:
# 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 = 'hidden here only';
# Instantiates a client
$bigquery = new BigQueryClient([
'projectId' => $projectId
]);
# The name for the new dataset
$datasetName = 'test_dataset';
# Creates the new dataset
$dataset = $bigquery->createDataset($datasetName);
echo 'Dataset ' . $dataset->id() . ' created.';
私はちょうど図書館経由のBigQuery内のデータセットを作成されてやろうとしているすべてが、私は次のエラーのためにすることはできませんよ。
Fatal error: Uncaught Google\Cloud\Exception\ServiceException: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information in /Applications/MAMP/htdocs/projects/work/bigquery-tests/vendor/google/cloud/src/RequestWrapper.php on line 219
例のコードに示すとおり、ブラウザにログインした後でもエラーが発生していますが、gcloud beta auth applications-default login
を実行しようとしました。どんな助けも素晴らしいだろう、ありがとう!
これを行うには、 'google/apiclient'の依存関係は必要ありません。 'putenv'呼び出しは、' ServiceBuilder'をインスタンス化するのに十分でなければなりません。 – jdp
@ Pentium10どのようにしてキーファイルをダウンロードできますか?キーを表示する権限がありますが、ダウンロードボタンは表示されません。 –
@JoeScottoキーファイルをダウンロードする方法については、次のリンクをご覧ください。 https://googlecloudplatform.github.io/google-cloud-php/#/docs/v0.20.1/guides/authentication –