PHP 5 telah mencapai akhir dukungan dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi PHP 5, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi PHP 5 yang sudah ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda bermigrasi ke versi PHP terbaru yang didukung.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Aplikasi PHP 5 memerlukan bucket Google Cloud Storage yang dikonfigurasi
dengan benar. Untungnya, setiap aplikasi dapat dengan mudah mendapatkan akses ke bucket tersebut jika Anda melakukan
hal berikut:
Saat menggunakan bucket default, Anda tidak perlu mengetahui nama bucket:
Anda dapat menggunakan #default# dan nama ini akan diganti pada saat runtime dengan nama bucket default.
Misalnya, Anda akan menulis ke bucket default menggunakan wrapper streaming
App Engine untuk Cloud Storage:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 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);"]]