【问题标题】:AppEngine PHP storage not working in productionAppEngine PHP 存储在生产环境中不起作用
【发布时间】: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


    【解决方案1】:

    可能是存储桶名称错误。尝试这样的方法,在运行时查找存储桶名称。

    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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-05
      • 2023-04-01
      相关资源
      最近更新 更多