IntelliJ IDEA 2018.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
icons general settings svg


The dialog is available only when the PHP Remote Interpreter plugin is enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Managing Plugins.

The dialog opens when you click Add icons general add svg in the left-hand pane of the CLI Interpreters dialog and choose From Docker, Vagrant, VM, Remote... from the drop-down 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

Vagrant

This option is available only when the Vagrant repository plugin is installed and enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Managing Plugins.

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.

Deployment Configuration

This option is available only when the Remote Hosts Access plugin is enabled. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins settings page as described in Managing Plugins.

Choose this option to configure access to a PHP interpreter on a remote host using a server access configuration. This option is available only if you have at least one server access configuration of the type SFTP, see Creating a Remote Server Configuration.

From the Deployment Configuration drop-down list, choose the server access configuration of the SFTP type according to which you want IntelliJ IDEA to connect to the target host. If the settings specified in the chosen configuration ensure successful connection, IntelliJ IDEA displays the URL address of the target host as a link in the Deployment Host URL 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. By default, IntelliJ IDEA retrieves path mappings from the chosen server access (deployment) configuration. If the configuration does not contain path mappings, IntelliJ IDEA displays the corresponding error message.

To fix the problem, open the Deployment page under the Build, Execution, Deployment node, select the relevant server access configuration, switch to the Mappings tab, and map the local folders to the folders on the server as described in the Mapping local folders to folders on the server and the URL addresses to access them section.

SSH Credentials

Choose this option to configure access to a PHP interpreter on a remote host through SSH credentials. In the fields of the dialog, specify the following:
  • Host: in this field, type the name of the host on which the interpreter is installed.

  • Port: in this field, type the port which the SSH server on the remote host listens to. The default port number is 22.

  • User name: in the field, type the user name under which you are registered on the SSH server.

  • Auth type: from this list, choose the authentication method.
    • To access the host through a password, choose Password from the Authentication type list, specify the password, and select the Save password checkbox to have IntelliJ IDEA remember it.

    • To use SSH authentication via a key pair, choose Key pair (OpenSSH or PuTTY). To apply this authentication method, you need to have your private key on the client machine and your public key on the remote server you connect to. IntelliJ IDEA supports private keys generated using the OpenSSH utility.

      Specify the path to the file where your private key is stored and type the passphrase (if any) in the corresponding fields. To have IntelliJ IDEA remember the passphrase, select the Save passphrase checkbox.

    • If your SSH keys are managed by a credentials helper application (for example, Pageant on Windows or ssh-agent on Mac and Linux), choose OpenSSH config and authentication agent.

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 above, in the Host field, 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 in question, switch to the Mappings tab, and map local folders to folders on the server as described in Creating 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 settings page as described in Managing 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 Docker for details. Choose a configuration from the list or click browseButton and create a new configuration in the Docker dialog box 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 drop-down 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 image repository specified on the 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 settings page as described in Managing 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 Docker for details. Choose a configuration from the list or click browseButton and create a new configuration in the Docker dialog box 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 Using Environment Variables 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, IntelliJ IDEA by default suggests the /usr/bin/php folder.

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

  • For Docker containers, IntelliJ IDEA by default suggests the php folder.

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.

Last modified: 20 November 2018

See Also