【问题标题】:Google Cloud Storage bucket not readable. (CloudStorageStreamWrapper::stream_open call failed)Google Cloud Storage 存储分区不可读。 (CloudStorageStreamWrapper::stream_open 调用失败)
【发布时间】:2014-10-24 19:42:39
【问题描述】:

我正在尝试将 Laravel 刀片模板读/写到 Google Cloud Storage 存储桶。

已编译的模板正确写入存储桶,但是当视图尝试从存储桶中读取已编译的模板时,我收到以下错误:

包括(gs://my-site.appspot.com/views/c08e5794b1fc664fce0cd30fc8e7898e): 无法打开流: “\google\appengine\ext\cloud_storage_streams\CloudStorageStreamWrapper::stream_open” 调用失败

为什么应用程序能够成功写入存储桶,但无法读回?

【问题讨论】:

  • 在这里您可以找到示例代码来读取/写入 GCS 文件并为带有或不带有 blob_key 的模板创建服务 url:github.com/voscausa/appengine-gcs-blobstore-python
  • 更具体地说,它不起作用,因为 'include' 不理解 'gs://' URL。使用上面 voscausa 的链接,您可以创建一个有效的服务 URL。

标签: google-app-engine laravel google-cloud-storage


【解决方案1】:

如果您需要包含存储桶中的文件,请添加到您的 php.ini:

google_app_engine.allow_include_gs_buckets = "views"

【讨论】:

  • 谢谢,我使用了完整的存储桶名称。我需要 fopen
猜你喜欢
  • 2019-03-31
  • 2017-11-15
  • 2014-01-05
  • 1970-01-01
  • 1970-01-01
  • 2017-12-23
  • 1970-01-01
  • 2018-08-07
  • 2017-07-07
相关资源
最近更新 更多