IntelliJ IDEA 2021.1 Help

CLI Interpreters

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

The dialog opens when you click the Browse button next to the CLI Interpreter list in the Development environment section of the PHP page.

Use this dialog to configure PHP engines as interpreters, see Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters. In this dialog, you can add new interpreters and edit or remove the existing ones.

The dialog consists of two panes. The left-hand pane lists all the configured PHP interpreters, both local and remote ones, and contains a toolbar for adding, removing, and copying PHP interpreter configurations. The contents of the right-hand pane depend on the type of the interpreter currently selected in the left-hand pane. Use the controls in this pane to edit the settings of the selected interpreter and even choose its type, if necessary.

Left-hand pane

The left-hand pane lists all the configured PHP interpreters, both local and remote ones, and contains a toolbar for adding, removing, and copying PHP interpreter configurations.

ItemTooltipDescription
the Add buttonAddClick this button to add a new PHP interpreter to the list. From the popup list, choose the interpreter type (Local or Remote ), and configure a local interpreter in the right-hand pane or a remote interpreter in the Configure PHP Remote Interpreter Dialog dialog that opens.
the Remove buttonDeleteClick this button to remove the selected interpreter from the list.
the Copy buttonCopyClick this button to create a new interpreter with the settings copied from the selected one.

Right-hand pane

The contents of the right-hand pane depend on the type of the interpreter currently selected in the left-hand pane. Use the controls in this pane to edit the settings of the selected interpreter and even choose its type, if necessary.

Remote interpreter accessible through SSH

ItemDescription
SSH configuration

From this list, choose one of the created SSH configurations, or click the Browse button and create a new configuration as described in Create SSH configurations.

Remote interpreter on a Vagrant instance

ItemDescription
Vagrant instance folder

In this field, choose the folder that points at the environment you are going to use. 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.

Remote interpreter in a Docker container

ItemDescription
ServerIn this 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.
Image nameIn this 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.

Remote interpreter running in a multi-container Docker Compose application

ItemDescription
Serverin this 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.
Configuration file(s)In this field, specify the docker-compose.yml file defining the application's services.
ServiceIn this field, choose the desired application's service.
Environment variablesIn this field, define the environment variables. See Using Environment Variables for details.
LifecycleIn this area, choose how the Docker container for the selected service should be managed by IntelliJ IDEA.
  • Always start a new container ('docker-compose run'): choose this option to have the container started via the run command. The container will be restarted upon each run.

  • Connect to existing container ('docker-compose exec'): choose this option to have the container started once, and then connect to it via the exec command.

Remote interpreter running through Windows Subsystem for Linux (WSL)

ItemDescription
Linux DistributionFrom this list, choose one of the installed Linux distributions to use.

General area

ItemDescription
NameIn this field, type the identifier to distinguish the interpreter from others, for example, php_installation_<version>.
PHP executable

In this field, specify the path to the PHP engine. Type the path manually or click Open and choose the executable file in the dialog that opens. IntelliJ IDEA detects the version of PHP and displays it in the PHP version read-only field.

IntelliJ IDEA also detects the debugging engine and the php.ini configuration file. The type of the debugging engine associated with the PHP interpreter and its version are displayed in the Debugger read-only field. If no debugger is detected or you have disabled it in php.ini file (see Configuring Xdebug for Using in the On-Demand Mode ), the field shows Debugger: Not installed.

The location of php.ini is displayed in the Configuration file read-only field. To edit the php.ini in IntelliJ IDEA, click Open in Editor.

Reload

the Reload phpinfo button

Click this button to check that the specified PHP home directory actually contains a PHP executable file. If no PHP executable is detected at the specified location, IntelliJ IDEA displays the corresponding error message.

Show phpinfo

the Show phpinfo button

Click this button to have IntelliJ IDEA display a separate information window with the installation details and the list of loaded extensions and configured options. Note that the additional options specified in the Configuration Options field of the PHP Interpreters dialog are not listed.

Advanced area

ItemDescription
Debugger extension

In this field, specify the location of the Xdebug extension to enable IntelliJ IDEA to activate it when necessary.

IntelliJ IDEA supports the On-Demand mode, where you can disable debugger for your global PHP installation and have it enabled automatically on demand only when you are debugging your command-line scripts or when you need code coverage reports. This lets your command line scripts (including Composer and unit tests) run much faster.

Configuration OptionsUse this field to customize the configuration settings of the installation by composing a string of configuration directives to be passed through the -d command line option and thus add new entries to the php.ini file. Click Open to open the Configuration Options dialog and create a list of new php.ini entries there.

Configuration options dialog

ItemTooltip and
Shortcut
Description
NameIn this field, type the name of the new entry.
ValueIn this field, type the value of the new entry.
NewAdd
Alt+Insert
Click this button to have a new line added to the list and specify the name and value of a new entry there.
the Remove buttonRemove
Alt+Delete
Click this button to remove the selected entry from the list.
the Move up buttonthe Move down buttonUp / Down
Alt+Up  /  Alt+Down
Use these buttons to move the selected entry up or down in the list. The order of entries in the list determine the order in which they are passed through the -d command line option.

You can add as many entries as you need, just keep in mind that they will be transformed into a command line with its length limited to 256 characters.

Last modified: 08 March 2021