Your PHP 5 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 might incur costs by using a Cloud Storage bucket. Each project can have a default bucket, which includes 5GB of free storage and a free quota for I/O operations.

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 App Engine stream wrapper for Cloud Storage:

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