IntelliJ IDEA 2017.1 Help

Configuring Local PHP Interpreters

This feature is supported in the Ultimate edition only.

The term local PHP interpreter denotes a PHP engine installed on your computer opposite to remote PHP interpreters that can be installed on a remote host or in a virtual environment set up in a Vagrant instance, see Configuring Remote PHP Interpreters.

  1. Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or IntelliJ IDEA | Preferences for macOS, and click PHP under Languages & Frameworks.
  2. On the PHP page that opens, click the /help/img/idea/2017.1/browseButton.png button next to the CLI Interpreter drop-down list in the Development environment section.
  3. In the CLI Interpreters dialog box that opens, click the Add toolbar button /help/img/idea/2017.1/new.png   in the left-hand pane, then choose Local on the context menu. If you already have a local interpreter configured in IntelliJ IDEA, it is also shown on the menu and the menu item changes to Other Local.
  4. In the right-hand pane of the dialog box, specify the PHP interpreter's settings.
    1. In the Name text box, type the identifier to distinguish the interpreter from others, for example, php_installation_<version>.
    2. Specify the PHP engine installation directory in the PHP Home field. Type the path manually or click the Browse button /help/img/idea/2017.1/browseButton.png   and choose the location in the Choose PHP Home dialog box, that opens.

      IntelliJ IDEA displays the version of the PHP engine detected in the specified folder and the debugger associated with this PHP engine in the php.ini file.

  5. Optionally, customize the configuration settings of the installation in the Additional area. In the Debugger extension text box, specify the path to Xdebug. This enables IntelliJ IDEA to activate Xdebug when it is necessary is you have disabled it in the php.ini file, see Configuring Xdebug for Using in the On-Demand Mode.
    • In the Configuration options field, compose a string of configuration directives to be passed through the -d command line option and thus add new entries to the php.ini file. The directives specified in this field override the default directives generated by IntelliJ IDEA, such as -dxdebug.remote_enable=1, -dxdebug.remote_host=, -dxdebug.remote_port=9001, -dxdebug.remote_mode=req.

      For example, if you specify the -dxdebug.remote_mode=jit directive it will override the default -dxdebug.remote_mode=req directive and thus switch Xdebug to the Just-In-Time (JIT) mode, see Debugging in the Just-In-Time Mode for details.

      To do that, click the Browse button browseButton.png next to the Configuration options field, and then create a list of entries in the Configuration Directives dialog box, that opens.

      • To add a new entry, click the Add button add.png. In the new line, that is added to the list, specify the name of the new entry and its value in the Name and Value text boxes respectively.

        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.

      • To delete an entry, select it in the list and click the Remove button delete.png.
      • To change the order of entries, use the Up arrowUp.png  and Down arrowDown.png buttons.

      Upon clicking OK, you return to the CLI Interpreters dialog box, where the entries are transformed into a command line.

  6. Click the Show phpinfo button to have IntelliJ IDEA display a separate information window where you can examine the installation details and view the list of loaded extension and configured options. Please note that the options specified in the Configuration Options field of the CLI Interpreters dialog box are not listed.

See Also

Last modified: 18 July 2017