This sample application demonstrates how to use Cloud Storage with Google App Engine.
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>inindex.phpto the name of your Cloud Storage Bucket.
Prerequisites
- Install the Google Cloud SDK.
Run Locally
Create a local directory for the Dev AppServer to use for Cloud Storage:
mkdir /tmp/gs
Note: This directory can be wherever you like, as long as it's consistent with the
--storage_pathoption below.
Run the sample with dev_appserver.py:
cd /path/to/php-docs-samples/appengine/standard/storage
dev_appserver.py --php_executable=/usr/local/bin/php-cgi --storage_path=/tmp/gs .
Note: Your PHP executable path may be different than the one above.
Now browse to http://localhost:8080 to view the sample.
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.