【发布时间】:2015-01-30 00:05:54
【问题描述】:
$file = 'gs://myapp.appspot.com/storage.json';
file_put_contents($file, $array);
$response = file_get_contents($file);
当我在本地运行 appengine 时,这可以正常工作,但在生产环境中不起作用。欢迎提出任何建议。
【问题讨论】:
标签: php google-app-engine
$file = 'gs://myapp.appspot.com/storage.json';
file_put_contents($file, $array);
$response = file_get_contents($file);
当我在本地运行 appengine 时,这可以正常工作,但在生产环境中不起作用。欢迎提出任何建议。
【问题讨论】:
标签: php google-app-engine
可能是存储桶名称错误。尝试这样的方法,在运行时查找存储桶名称。
use google\appengine\api\cloud_storage\CloudStorageTools;
$bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();
$file = "gs://$bucket/storage.json";
file_put_contents($file, $array);
$response = file_get_contents($file);
【讨论】: