PhpStorm 2024.2 Help

Run applications

Quick way

If you are not going to pass any parameters to your program, and your program does not require any actions to be performed before start, you can run it from the editor or the toolbar using a temporary configuration.

Run the current file

Open the file in the editor and use one of the following options to run it:

  • Right-click anywhere in the editor area to open the context menu and then select Run and <script name> the Debug PHP script icon from it.

    Run PHP script from the editor
  • On the toolbar above the editor, select the Current File option from the drop-down menu and click Run next to it.

    Running a single file from the toolbar

    You can access other runners from the main toolbar as well: expand the list and select Current File. From the widget that opens, you can open the run configuration to specify more options.

    More options for running current file

When the application starts, you can view its output and interact with it in the Run tool window.

A tabs in the Run tool window

Open the current file in browser

PhpStorm comes with a built-in web server. If a local PHP interpreter is configured in the project, the built-in web server can be started to preview, run, and debug PHP scripts.

To render the PHP program output with a web browser, do one of the following:

  • Open the file in the editor and press Alt+F2.

  • Right-click the file in the Project tool window and select Open in Browser.

  • In the main menu, go to View | Open in Browser.

  • Use the browser popup in the top right part of the editor window (appears on hover). Click the browser button to open the web server file URL, or Shift+Click it to open the local file URL.

    Show in browser

Customizable way

If you are going to pass parameters to your program or otherwise customize the startup of your program, or just want to make the program run reusable, use a run/debug configuration.

Edit and save a temporary configuration, or create a new run/debug configuration from a template and use one of the following options to run it:

  • Click Run from the Run/Debug Configurations dialog.

    Run/debug configuration: the Run button
  • Select the configuration from the toolbar switcher and click The Run button or press Shift+F10.

    Run configuration selector
  • Press Alt+Shift+F10 and select the configuration on the pop-up window that opens.

    Run configuration popup selector

Re-run applications

  • On the toolbar of the Run tool window, click the Rerun button or press Shift+F10.

Stop and pause applications

When you stop a program, its process is interrupted and exits immediately. When you pause a program, it continues running in the background, but its output is suspended.

Stop a program

  • In the Run tool window, click the Stop button on the toolbar. Alternatively, press Ctrl+F2 and select the process to stop.

Pause the program output

  • Right-click in the Run tool window and select Pause Output from the context menu. Use the same toggle to resume the program.

Show running processes

You can view the list of all active run or debug sessions and navigate between them.

  • Go to Run | Show Running List. In the top-right corner of the editor, PhpStorm shows a list with all active applications.

CPU and Memory Live Charts

PhpStorm provides a way to monitor live performance statistics for a running process through CPU and Memory Live Charts.

As opposed to viewing static figures, live data may help you to visualize resource consumption, identify resource-related bottlenecks, and understand how certain events affect the program performance.

For example, in the picture below, we can see what a memory leak looks like in the Heap Memory chart. Sometimes it is enough to figure out the cause, and when it is not enough, it can give a clue for further investigation.

Memory leak on CPU and Memory Live Charts

CPU and Memory Live Charts are automatically shown for all programs that you run from PhpStorm:

CPU and Memory Live Charts in the Run tool window

For more information, refer to Monitor resources usage.

Last modified: 12 November 2024