PhpStorm 2021.2 Help

Run, debug, and upload an application to Google App Engine for PHP

PhpStorm provides the possibility to run and debug your applications locally on the PHP Development Server before uploading them to the Google PHP Runtime Environment. Applications are launched locally according to a dedicated App Engine for PHP run/debug configuration.

In this section:

Working with the app.yaml file

A Google App Engine PHP application is configured in the app.yaml file. If you generate a project stub (see Develop a Google App for PHP application), the app.yaml file is created automatically. If you activate Google App Engine support in an existing project, you need to create an app.yaml file manually. In either case, make sure the runtime property is set to php55, because the Google App Engine for PHP SDK contains a built-in PHP 5.5 interpreter.

Creating a run configuration of the type App Engine for PHP

  1. On the main menu, go to Run | Edit Configurations, click Icons general add and select App Engine for PHP from the list. The App Engine for PHP opens.

  2. Specify the host to run the development server and the application on (the default is localhost).

  3. Specify the port through which PhpStorm will communicate with the development server (the default port is 8080).

  4. Optionally in the Command Line area, specify the settings for running and debugging your application on the PHP development server in the command-line mode:

    • In the Interpreter options field, specify the options to be passed to the PHP executable file of the built-in PHP interpreter, see Command-Line Arguments for details.

    • In the Custom working directory field, specify the location of the files that are outside the folder with your sources and are referenced through relative paths. Type the path manually or click Browse the Browse button and select the desired folder in the dialog that opens.

    • In the Yaml files field, specify the .yaml configuration files to use. This field is optional, use it when your application consists of several modules and therefore several .yaml configuration files are used.

    • In the Environment variables field, In this field, specify the environment variables be passed to the built-in server. See Environment Variables in Apache for details.

Running an application on the PHP development server

  1. Create an App Engine for PHP run configuration as described above.

  2. Choose the configuration from the list and click the Run button on the toolbar.

  3. View and analyze the output of the application in console of the Run tool window.

  4. To view the application execution results, open your browser at http://localhost:8080.

Debugging an application on the PHP development server

  1. Create an App Engine for PHP run configuration as described above.

  2. Set the breakpoints in your code, see Breakpoints.

  3. Choose the configuration from the list and click the Debug button

  4. In the Debug tool window that opens, step through the program, pause and resume the program, examine it when suspended, and so on.

Uploading an application to the Google PHP runtime environment

After you have tested your application by running and debugging it locally on the development server, you can deploy it to the Google PHP Runtime Environment.

  1. From the main menu, select Tools | Google App Engine for PHP | Upload App Engine PHP app.

  2. Visit the application at http://<your-application-id>.appspot.com/.

Last modified: 08 March 2021