IntelliJ IDEA 13.1.0 Web Help

Some features described here are available in Ultimate edition only.

To get PHP development support at the IntelliJ IDEA level, download, install, and enable the PHP repository plugin.

Deployment of PHP applications is provided via the Remote Hosts Access bundled plugin. The plugin is by default activated. If not, enable it in the Plugin Configuration Wizard or the Plugins page of the Settings dialog box.

You can have as many PHP engine versions installed and configured at the IntelliJ IDEA level and switch among them. However, within a project, you can have only one of these configurations activated.

In this sections:

To configure a PHP installation in IntelliJ IDEA
  1. Open the project settings and click PHP.
  2. Click the Browse button browseButton   next to the Interpreter drop-down list in the Development environment section.
  3. In the Interpreters dialog box, that opens, click the Add toolbar button add   on the left-hand pane.
  4. On the right-hand pane of the dialog box, specify the PHP installation settings.
    1. In the Name text box, type the identifier to distinguish the installation 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 browseButton   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 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. 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 Interpreters dialog box, where the entries are transformed into a command line.

To enable PHP development support in a project
  1. Open the project settings and click PHP.
  2. In the PHP page that opens, choose the installation to use from the Interpreter drop-down list.
    • To make sure that the configuration you have chosen points at the relevant installation, click the Reload button refresh.png  next to the drop-down list. If no PHP engine is actually installed at the specified directory, IntelliJ IDEA displays the corresponding error message.
    • To examine the installation details, click the Show phpinfo button show_php_info.png  next to the drop-down list and view the full list of installation settings in a separate window. Actually, IntelliJ IDEA checks the installation and displays the result of executing the phpinfo command.
  3. In the PHP language level drop-down list, specify the PHP functionality scope to get coding assistance for. Each functionality scope is associated with PHP version that supports this functionality.

    No correlation between the PHP version used in the project and the language level is enforced. Although the language version of each interpreter is detected automatically, you can still tell IntelliJ IDEA to provide you with coding assistance that corresponds to another language level. However, if you attempt to use a code construct that is not supported by the specified language level, IntelliJ IDEA suggests a Switch to PHP <version> quick-fix.

See Also



Web Resources: