This sample application demonstrates how to use Cloud Storage on App Engine for PHP 7.2.
Before running this sample:
- Install
composer - Install dependencies by running:
composer installBefore you can run or deploy the sample, you will need to do the following:
- Set
<your-bucket-name>inapp.yamlto the name of your Cloud Storage Bucket.
First, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the
path to a set of downloaded
service account credentials.
Next, set the GOOGLE_STORAGE_BUCKETenvironment variable to the name of a
Cloud Storage bucket in the same project as the credentials you downloaded.
Make sure the service account you created has access.
Finally, run the PHP built-in web server to serve the demo app:
php -S localhost:8080
Now browse to http://localhost:8080 to view the sample.
Prerequisites
- Install the Google Cloud SDK.
Deploy with gcloud
gcloud config set project YOUR_PROJECT_ID
gcloud app deploy
gcloud app browse
The last command will open https://{YOUR_PROJECT_ID}.appspot.com/
in your browser.