PhpStorm 2017.1 Help

Running, Debugging, and Uploading 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 Preparing to 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 fo the type App Engine for PHP

  1. On the main menu, choose Run | Edit Configurations.
  2. Click the Add New Configuration toolbar button add.png, and choose App Engine for PHP on the context menu.
  3. In the Run/Debug Configuration: App Engine for PHP dialog box that opens, specify the host to run the development server and the application on, the default is localhost , and 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 the Browse button /help/img/idea/2017.1/browseButton.png 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 run.png 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 Using Breakpoints.
  3. Choose the configuration from the list and click debug.png
  4. In the Debug tool window that opens, step through the program, stop and resume the program, examine it when suspended, etc. See Stepping Through the Program, Pausing and Resuming a Debugging Session, and Examining a Suspended Program for details. ,

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. On the main menu, choose Tools | Google App Engine for PHP | Upload App Engine PHP app.
  2. Visit the application at http://<your-application-id>.appspot.com/.

See Also

Last modified: 19 July 2017