This sample demonstrates how to deploy a very basic Slim application to Google App Engine for PHP. For a more complete guide, follow the Building an App tutorial.
Before running this sample:
- Go to Google Developers Console and create a new project.
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.
The application consists of three components:
- An
app.yaml
which sets your application runtime to bephp81
. - A
composer.json
which declares your application's dependencies. - An
index.php
which handles all the requests which get routed to your app.
The index.php
file is the most important. All applications running on App Engine
for PHP require use of a front controller file.