IntelliJ IDEA 2020.2 Help

Configure PHP Remote Interpreter Dialog

File | Settings | Languages and Frameworks | PHP for Windows and Linux
IntelliJ IDEA | Preferences | Languages and Frameworks | PHP for macOS
Ctrl+Alt+S
the Settings/Preferences icon

The dialog is available only when the PHP Remote Interpreter plugin is enabled. The PHP Remote Interpreter plugin is not bundled with IntelliJ IDEA, but it can be installed on the Settings/Preferences | Plugins page as described in Installing plugins from JetBrains repository.

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, 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.

ItemDescription
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. IntelliJ IDEA first attempts to retrieve path mappings itself by processing all the available application-level configurations. If IntelliJ IDEA 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, IntelliJ IDEA 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 Integration plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Plugins page as described in Manage 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 the Browse button 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 Integration plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Plugins page as described in Manage 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:

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, IntelliJ IDEA by default suggests the /usr/bin/php location.

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

  • For Docker containers, IntelliJ IDEA 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, IntelliJ IDEA checks whether the PHP executable is actually stored in the specified folder.

  • If no PHP executable is found, IntelliJ IDEA 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 IntelliJ IDEA, but it can be installed on the Settings/Preferences | Plugins page 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, IntelliJ IDEA 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. IntelliJ IDEA evaluates path mappings from the VagrantFile configuration file.

Last modified: 03 September 2020