简体   繁体   English

无法通过App Engine包含Google Cloud Storage中的内容吗?

[英]Can't include from Google Cloud Storage with App Engine?

I've spent all day on this!! 我花了整整一整天的时间!! Why can't I include from my Google Cloud Storage from my App Engine app? 为什么我的App Engine应用程序无法包含我的Google Cloud Storage中的内容?

Here is my main.php: 这是我的main.php:

<?php
error_reporting(E_ALL);
echo "echo is working<br />";
include ("gs://myappid.appspot.com/test.php");
?>

Here is test.php: 这是test.php:

echo "hello world!";

Here is my app.yaml: 这是我的app.yaml:

application: myappid
version: 1
runtime: php55
api_version: 1
threadsafe: true

handlers:
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
  static_files: \1
  upload: .+\.(gif|png|jpg)$
  application_readable: true


# Serve php scripts.
- url: /(.+\.php)$
  script: \1

I have deployed this app and when I navigate to main.php, I just see the first echo echo is working . 我已经部署了这个应用程序,当我导航到main.php时,我只看到第一个echo echo is working

My storage bucket is the default for the app: myappid.appspot.com. 我的存储桶是该应用程序的默认存储桶:myappid.appspot.com。 And both the bucket and test.php have got the permission of: USER | 并且bucket和test.php都获得了以下用户的许可: myappid@appspot.gserviceaccount.com | myappid@appspot.gserviceaccount.com | OWNER 所有者

And my php.ini is: 而我的php.ini是:

output_buffering = "On"
google_app_engine.disable_readonly_filesystem=1
google_app_engine.allow_include_gs_buckets = "gs://myappid.appspot.com"

According to Google's docs, other SO questions and several blog posts, this should work. 根据Google的文档,其他SO问题和几篇博客文章,这应该可行。 Any idea what I'm doing wrong please? 知道我在做什么错吗?

Fixed by altering the php.ini. 通过更改php.ini进行修复。 I changed this: 我改变了这个:

google_app_engine.allow_include_gs_buckets = "gs://myappid.appspot.com"

to

google_app_engine.allow_include_gs_buckets = "#default#"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM