PHP 5는 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 PHP 5 애플리케이션을 배포할 수 없습니다. 기존 PHP 5 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 PHP 버전으로 마이그레이션하는 것이 좋습니다.
PHP 5 앱에서 런타임 중에 파일을 읽고 써야 하는 경우 또는 동영상, 이미지, 기타 정적 콘텐츠와 같은 파일을 제공해야 하는 경우 Cloud Storage 버킷을 사용하는 것이 좋습니다.
앱을 만들면 App Engine이 기본 버킷을 만듭니다. 이 버킷은 처음 5GB의 스토리지를 무료로 제공하며 Cloud Storage I/O 작업의 무료 할당량을 포함합니다. 다른 Cloud Storage 버킷을 만들 수 있지만 기본 버킷에만 처음 5GB의 무료 스토리지가 포함되어 있습니다.
App Engine에 Cloud Storage 사용
App Engine 앱에서 Cloud Storage 버킷을 사용하려면 다음 안내를 따르세요.
App Engine 프로젝트에서 기존 버킷의 이름을 확인합니다. Cloud Storage에서 데이터를 업로드하거나 다운로드할 때 이 이름을 지정합니다.
Cloud Storage 버킷의 이름을 앱에 하드 코딩하지 않고 앱의 환경 변수에 저장하는 것이 좋습니다.
앱을 만들 때 App Engine이 처음 5GB의 무료 스토리지를 제공하는 기본 버킷을 만듭니다. 기본 버킷에는 Cloud Storage I/O 작업을 위한 무료 할당량도 포함되어 있습니다. 자세한 내용은 가격 책정, 할당량, 한도를 참조하세요. 5GB 제한을 초과하는 스토리지를 사용하면 요금이 청구됩니다.
기본 버킷 이름의 형식은 다음과 같습니다.
project-id.appspot.com
App Engine은 앱의 새 버전을 배포할 때 임시 스토리지에 사용할 버킷도 만듭니다. 이름이 staging.project-id.appspot.com인 이 버킷은 App Engine에서만 사용됩니다. 앱은 이 버킷과 상호작용할 수 없습니다.
버킷 및 객체 권한 설정
앱과 연결된 서비스 계정에는 프로젝트에서 버킷을 읽고 쓸 수 있는 권한이 필요합니다. 필요한 권한을 알아보려면 Cloud Storage의 IAM 역할을 참조하세요.
자동 역할 부여를 중지한 경우 기본 서비스 계정에 부여할 역할을 결정한 후 직접 이러한 역할을 부여해야 합니다.
기본 서비스 계정에 이미 편집자 역할이 있으면 편집자 역할을 권한이 더 낮은 역할로 바꾸는 것이 좋습니다.서비스 계정 역할을 안전하게 수정하려면 정책 시뮬레이터를 사용하여 변경사항의 영향을 확인한 후 적절한 역할을 부여하고 취소합니다.
다른 사용자, 앱, 프로젝트에서 버킷과 해당 콘텐츠에 액세스하도록 허용하는 방법은 버킷 권한 설정 및 객체 권한 설정을 참조하세요.
로컬 개발 서버에서 Cloud Storage 사용
App Engine 로컬 개발 서버는 Cloud Storage를 에뮬레이션하지 않으므로 모든 Cloud Storage 요청은 인터넷을 통해 실제 Cloud Storage 버킷에 전송해야 합니다.
가격 책정, 할당량, 한도
Cloud Storage 클라이언트 라이브러리에서 Cloud Storage를 호출할 때 부과되는 대역폭 요금이 없습니다. 하지만 작업 비용은 청구됩니다.
또한 라이브러리가 Cloud Storage와 상호작용하는 데 URL Fetch 서비스를 사용하므로 호출 수가 URL Fetch 할당량에 반영됩니다.
Cloud Storage는 유료 서비스이며 Cloud Storage 가격표에 따라 비용이 청구됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis page guides you on using the recommended Google Cloud Client Library APIs for Cloud Storage with App Engine, supporting environments beyond just App Engine.\u003c/p\u003e\n"],["\u003cp\u003ePHP 5 apps can use legacy App Engine APIs but are limited to App Engine and must upgrade to the recommended APIs for migration to newer App Engine runtimes.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine creates a default Cloud Storage bucket for each app, providing 5GB of free storage and a free quota for I/O operations, but only this default bucket offers free storage.\u003c/p\u003e\n"],["\u003cp\u003eTo use Cloud Storage, you need to list your bucket names, declare Cloud Storage as a dependency in your app using \u003ccode\u003ecomposer\u003c/code\u003e, and register \u003ccode\u003eGoogle\\Cloud\\Storage\\StorageClient\u003c/code\u003e as the stream wrapper to read and write files using the \u003ccode\u003egs\u003c/code\u003e protocol.\u003c/p\u003e\n"],["\u003cp\u003eWhile there are no bandwidth charges for Cloud Storage client library calls, operations charges apply, and these calls count against your URL fetch quota.\u003c/p\u003e\n"]]],[],null,["# Using Cloud Storage\n\n| **Key Point:** This page describes how to use the recommended APIs for Cloud Storage, which are in the [Google Cloud Client Library](https://googleapis.github.io/google-cloud-php/#/docs/cloud-storage/latest/storage/readme). These APIs enable your code to run in App Engine as well as other environments that support PHP 5.\n|\n| PHP 5 apps can continue to [use the legacy\n| App Engine APIs](/appengine/docs/legacy/standard/php/googlestorage), but such apps can only run in App Engine and will need to\n| upgrade to the recommended APIs before they can migrate to newer App Engine runtimes.\n\nIf your PHP 5 app needs to read and write files during runtime,\nor serve files such as movies, images or other static content, we recommend you\nuse a [Cloud Storage](/storage/docs) bucket.\n\nApp Engine creates a [default bucket](#default_bucket) when you create\nan app. This bucket provides the first 5GB of storage for free and includes a\nfree quota for Cloud Storage I/O operations. You can\n[create other Cloud Storage buckets](/storage/docs/creating-buckets),\nbut only the default bucket includes the first 5GB of storage for free.\n\nUsing Cloud Storage with App Engine\n-----------------------------------\n\nTo use a Cloud Storage bucket from an App Engine app:\n\n1. [View the names of the existing buckets](/storage/docs/listing-buckets)\n in your App Engine project. You'll specify these names when you\n upload or download data from Cloud Storage.\n\n We recommend that you store the names of your Cloud Storage buckets\n in your app's [environment variables](/appengine/docs/standard/reference/app-yaml#environment_variables)\n instead of hard coding them into your app.\n2. In your app, declare Cloud Storage as a dependency\n\n by adding `google/cloud-storage` to your app's `composer.json` file and running\n `composer install` from your app's directory. Learn more about\n [composer](https://getcomposer.org).\n\n \u003cbr /\u003e\n\n3.\n [Register `Google\\Cloud\\Storage\\StorageClient` as the\n stream wrapper](https://googleapis.github.io/google-cloud-php/#/docs/google-cloud/v0.122.0/storage/storageclient?method=registerStreamWrapper) for your app.\n Then use the `gs` protocol to read and write files.\n\n See an [example of registering and using the stream\n wrapper](https://github.com/googleapis/google-cloud-php/tree/master/Storage#stream-wrapper).\n\n As an alternative, you can [use the Google Cloud client library directly](/storage/docs/reference/libraries).\n\n### Using the default bucket\n\nWhen you create an app, App Engine creates a default bucket that\nprovides the first 5GB of storage for free. The default bucket also includes\na free quota for Cloud Storage I/O operations. See\n[Pricing, quotas, and limits](#pricing_quotas_and_limits) for details. You will\nbe charged for storage over the 5GB limit.\n\nThe name of the default bucket is in the following format: \n\n```\nproject-id.appspot.com\n```\n\n\u003cbr /\u003e\n\nApp Engine also creates a bucket that it uses for temporary\nstorage when it deploys new versions of your app. This bucket, named\n`staging.`\u003cvar translate=\"no\"\u003eproject-id\u003c/var\u003e`.appspot.com`, is for use by\nApp Engine only. Apps can't interact with this bucket.\n\n### Setting bucket and object permissions\n\nThe service account that's associated with your app needs permissions to read\nand write to buckets in your project. To learn which permissions are required,\nsee [IAM roles for\nCloud Storage](/storage/docs/access-control/iam-roles).\n\nTypically, the\nservice account that's associated with your app is the [default\nApp Engine service\naccount](/appengine/docs/legacy/standard/php/service-account).\n\n\nDepending on your organization policy configuration, the default service account might\nautomatically be granted the [Editor role](/iam/docs/roles-overview#basic) on your\nproject. We strongly recommend that you disable the automatic role grant by [enforcing the `iam.automaticIamGrantsForDefaultServiceAccounts` organization policy\nconstraint](/resource-manager/docs/organization-policy/restricting-service-accounts#disable_service_account_default_grants). If you created your organization after May 3, 2024, this\nconstraint is enforced by default.\n\n\nIf you disable the automatic role grant, you must decide which roles to grant to the default\nservice accounts, and then [grant these\nroles](/iam/docs/granting-changing-revoking-access) yourself.\n\n\nIf the default service account already has the Editor role, we recommend that you replace the\nEditor role with less permissive roles.To safely modify the service account's roles, use [Policy Simulator](/policy-intelligence/docs/simulate-iam-policies) to see the impact of\nthe change, and then [grant and revoke the\nappropriate roles](/iam/docs/granting-changing-revoking-access).\n\n\u003cbr /\u003e\n\nFor information about allowing other users, apps, or projects to access a bucket\nand its contents, see\n[Setting bucket permissions](/storage/docs/cloud-console#_bucketpermission)\nand\n[Setting object permissions](/storage/docs/cloud-console#_permissions).\n\nUsing Cloud Storage with the local development server\n-----------------------------------------------------\n\nThe App Engine local development server doesn't emulate Cloud Storage,\nso all Cloud Storage requests must be sent over the Internet to an\nactual Cloud Storage bucket.\n\nPricing, quotas, and limits\n---------------------------\n\nThere are no bandwidth charges associated with Cloud Storage client library\ncalls to Cloud Storage. However, there are\n[operations charges](/storage/pricing#operations-pricing).\nIn addition, the calls count against your\n[URL fetch quota](/appengine/docs/quotas#UrlFetch)\nas the library uses the URL Fetch service to interact with Cloud Storage.\n\nNotice that Cloud Storage is a pay-to-use service;\nyou will be charged according to the Cloud Storage\n[price sheet](/storage/pricing)."]]