Your app requires a properly configured Google Cloud Storage bucket. Fortunately, each app can easily gain access to such a bucket if you do the following:

  1. Enable billing for your project, if you haven't already done so.
  2. Click Create bucket in the Storage Browser for your project.

Note you may incur costs by using a Cloud Storage bucket, unless the bucket is a default bucket.

About default Cloud Storage buckets

Applications created using the old App Engine console could use a default Cloud Storage bucket, which had free quota and didn't require billing to be enabled for the app. These applications continue to work as before in the Google Cloud Platform Console.

However, for new projects created in the Google Cloud Platform Console, there is no default bucket.

Useful tricks when using default buckets

When using a default bucket, you don't actually need to know your bucket name: you can use #default# and this will be replaced at runtime by the name of the default bucket.

For example, you would write to the default bucket using the normal Cloud Storage stream wrapper:

$default_bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();
file_put_contents("gs://${default_bucket}/hello_default.txt", $newFileContent);


$default_bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();
$fp = fopen("gs://${default_bucket}/hello_default_stream.txt", 'w');
fwrite($fp, $newFileContent);

Send feedback about...