Google Cloud Client Library中的身份验证问题

时间:2018-04-04 14:11:43

标签: php google-bigquery bigdata

我正在从以下网址设置Google云端客户端库:

https://cloud.google.com/bigquery/docs/reference/libraries#client-libraries-usage-php

我已经从给定的网址创建了一个密钥:

https://console.cloud.google.com/apis/credentials/

enter image description here

并在环境变量中进行设置。

但我收到以下错误:

enter image description here

请帮忙。

1 个答案:

答案 0 :(得分:0)

它可以在命令提示符下工作:

php yourphpfilename.php

您还有另一种传递密钥文件的方法:

$credentialsFile = '[PATH_TO_JSON_KEY_FILE]';

# Instantiates a client
$bigquery = new BigQueryClient([
    'projectId' => $projectId,
        'keyFilePath' => $credentialsFile
]);

希望它会对你有所帮助。