【问题标题】:PHP Warning: Access Denied when GAE app try to access a bucketPHP 警告:当 GAE 应用程序尝试访问存储桶时访问被拒绝
【发布时间】:2013-11-20 17:14:39
【问题描述】:

我使用https://developers.google.com/appengine/docs/php/googlestorage/中的简单示例 但我收到了类似答案的警告访问被拒绝,这里是 PHP 代码:

函数访问GS(){

$options = [ "gs" => [ "Content-Type" => "text/plain" ]];
$ctx = stream_context_create($options);
file_put_contents("gs://mbucket/mFile.txt", "Hello", 0, $ctx);
return file_get_contents("gs://mBucket/mFile.txt");

}

【问题讨论】:

    标签: php google-app-engine google-cloud-datastore


    【解决方案1】:

    您似乎需要允许从您的应用读取存储桶。

    cloud console

    1. 选择您的项目
    2. 点击左侧导航中的“云存储”
    3. 选择有问题的桶(点击复选框而不是休息或线条)
    4. 添加用户(具有所需权限)(从左侧导航中的权限获取用户电子邮件)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-12
      • 2019-02-03
      • 1970-01-01
      • 2016-11-23
      • 2013-09-17
      • 2021-06-16
      • 2018-05-21
      相关资源
      最近更新 更多