PHP 5 has reached end of support and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy PHP 5
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing PHP
5 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you migrate to the latest supported version of PHP.
Stay organized with collections
Save and categorize content based on your preferences.
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:
Enable billing for your project, if you haven't already done so.
Click Create bucket in the Storage Browser for your project.
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:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis API supports first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes.\u003c/p\u003e\n"],["\u003cp\u003ePHP 5 apps require a configured Google Cloud Storage bucket, accessible by enabling billing and creating a bucket in the Storage Browser.\u003c/p\u003e\n"],["\u003cp\u003eEach project has a default bucket that includes 5GB of free storage and a free quota for I/O operations, which might incur additional costs.\u003c/p\u003e\n"],["\u003cp\u003eWhen using a default bucket, you can use \u003ccode\u003e#default#\u003c/code\u003e in place of the bucket name, which will be replaced at runtime, or find it programmatically with \u003ccode\u003eCloudStorageTools::getDefaultGoogleStorageBucketName()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can write to the default bucket using the App Engine stream wrapper, which will leverage functions such as \u003ccode\u003efile_put_contents\u003c/code\u003e and \u003ccode\u003efwrite\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Setup\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| php-gen2\n|\n| /services/access). If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\n\u003cbr /\u003e\n\nYour PHP 5 app requires a properly configured Google Cloud Storage\nbucket. Fortunately, each app can easily gain access to such a bucket if you do\nthe following:\n\n1. [Enable billing](https://console.cloud.google.com/billing) for your project, if you haven't already done so.\n2. Click **Create bucket** in the [Storage Browser](https://console.cloud.google.com/storage/browser) for your project.\n\nNote you might incur costs by using a Cloud Storage bucket. Each project can\nhave a default bucket, which includes\n[5GB of free storage and a free quota for I/O operations](/appengine/docs/quotas#Default_Gcs_Bucket).\n\n### Useful tricks when using default buckets\n\nWhen using a default bucket, you don't actually need to know your bucket name:\nyou can use `#default#` and this will be replaced at runtime by the name of the default bucket.\n| **Note:** The default bucket name is typically `\u003capp_id\u003e.appspot.com`, where `\u003capp_id\u003e` is your app ID. You can find the bucket name in the App Engine Admin console **Application Settings** page, under the label *Google Cloud Storage Bucket* . Alternatively, if you don't want to use `#default#`, you can use the [CloudStorageTools::getDefaultGoogleStorageBucketName()](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.cloud_storage.CloudStorageTools#method_getDefaultGoogleStorageBucketName) method to find the name programmatically.\n\nFor example, you would write to the default bucket using the App Engine\nstream wrapper for Cloud Storage: \n\n $default_bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();\n file_put_contents(\"gs://${default_bucket}/hello_default.txt\", $newFileContent);\n\nor \n\n $default_bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();\n $fp = fopen(\"gs://${default_bucket}/hello_default_stream.txt\", 'w');\n fwrite($fp, $newFileContent);\n fclose($fp);"]]