PhpStorm 2022.3 Help

Configure PHP Remote Interpreter Dialog

The dialog is available only when the PHP Remote Interpreter plugin is enabled. The PHP Remote Interpreter plugin is bundled with PhpStorm and activated by default. If the plugin is disabled, enable it on the Installed tab of the Settings | Plugins page, as described in Managing plugins.

The dialog opens when you click Add the Add button in the left-hand pane of the CLI Interpreters dialog and choose From Docker, Vagrant, VM, WSL, Remote from the popup menu.

Use this dialog to configure access to PHP engines installed on remote hosts or in development environments set up in Vagrant or Docker instances.

Item

Description

SSH

Choose this option to configure access to a PHP interpreter on a remote host through SSH credentials. From the SSH configuration list, choose one of the created SSH configurations, or click the Browse button and create a new configuration as described in Create SSH configurations.

To use an interpreter configuration, you need path mappings that set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. PhpStorm first attempts to retrieve path mappings itself by processing all the available application-level configurations. If PhpStorm finds the configurations with the same host as the one specified in the selected SSH configuration, the mappings from these configurations are merged automatically. If no configurations with this host are found, PhpStorm displays an error message informing you that path mappings are not configured.

To fix the problem, open the Deployment page under the Build, Execution, Deployment node, select the server access configuration, switch to the Mappings tab, and map local folders to folders on the server as described in Create a remote server configuration, section Mapping Local Folders to Folders on the Server and the URL Addresses to Access Them.

Docker

This option is available only when the PHP Docker and Docker plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Installed tab of the Plugins page as described in Install plugins.

Choose this option to configure access to a PHP interpreter running in a Docker container. In the fields of the dialog, specify the following:

  • In the Server field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New... and create a new configuration on the Docker page that opens.

  • In the Image name field, specify the base Docker image to use. Choose one of the previously downloaded or your custom images from the list or type the image name manually, for example, php:latest or php:7.0-cli. When you later launch the run configuration, Docker will search for the specified image on your machine. If the search fails, the image will be downloaded from the Docker Official Images repository on the Docker Registry page.

Docker Compose

This option is available only when the PHP Docker and Docker plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Installed tab of the Plugins page as described in Install plugins.

Choose this option to configure access to a PHP interpreter running in a Docker container in a multi-container application. In the fields of the dialog, specify the following:

  • In the Server field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New... and create a new configuration on the Docker page that opens.

  • In the Configuration file(s) field, specify the docker-compose.yml file defining the application's services.

  • In the Service field, choose the desired application's service.

  • Optionally, in the Environment variables field, define the environment variables. See Docker run configuration settings for details.

PHP Interpreter Path

In this field, specify the location of the PHP executable file in accordance with the configuration of the selected remote development environment.

  • For remote hosts, PhpStorm by default suggests the /usr/bin/php location.

  • For Vagrant instances, PhpStorm by default suggests the /usr/bin/php location.

  • For Docker containers, PhpStorm by default suggests the php location.

To specify a different folder, click Open and choose the relevant folder in the dialog that opens. Note that the PHP home directory must be open for editing.

When you click OK, PhpStorm checks whether the PHP executable is actually stored in the specified folder.

  • If no PHP executable is found, PhpStorm displays an error message asking you whether to continue searching or save the interpreter configuration anyway.

  • If the PHP executable is found, you return to the Interpreters dialog where the installation folder and the detected version of the PHP interpreter are displayed.

Vagrant

This option is available only when the Vagrant repository plugin is installed and enabled. The Vagrant plugin is not bundled with PhpStorm, but it can be installed on the Settings | Plugins page, tab Marketplace, as described in Installing plugins from JetBrains repository.

Choose this option to configure access to a PHP interpreter installed in a Vagrant instance using your Vagrant credentials. Technically, it is the folder where the VagrantFile configuration file for the desired environment is located. Based on this setting, PhpStorm detects the Vagrant host and shows it as a link in the Vagrant Host URL read-only field.

To use an interpreter configuration, you need path mappings that set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. PhpStorm evaluates path mappings from the VagrantFile configuration file.

Last modified: 17 March 2023