php-docs-samples/appengine/php72/slim-framework at php72-scripts · hadinem/php-docs-samples · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

README.md

Slim Example for App Engine for PHP 7.2

This sample demonstrates how to deploy a very basic Slim application to Google App Engine for PHP 7.2. For a more complete guide, follow the getting started tutorial.

Setup

Before running this sample:

Create a project (if you haven't already)

Deploy to App Engine

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.

Application Components

The application consists of three components:

  1. An app.yaml which sets your application runtime to be php72.
  2. A composer.json which declares your application's dependencies.
  3. 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 7.2 require use of a front controller file.