IntelliJ IDEA 2016.1 Help

Enabling PHP Support in a Project

To start PHP development in a project, you need to appoint one of the previously configured local or remote PHP interpreters to use and choose the PHP language level which determines the scope of PHP functionality to get coding assistance for. Currently PHP 5.3, PHP 5.4, PHP 5.5, and PHP 5.6 levels are supported.

To use PHP-related items from outside your project content root, configure include paths as described in Configuring Include Paths.

Enabling PHP development support in a project

  1. Open the Settings / Preferences Dialog by choosing File | Settings for Windows and Linux or IntelliJ IDEA | Preferences for OS X, and click PHP under Languages&Frameworks. Open the PHP page: choose File | Settings and in the Settings dialog box that opens, click PHP under Languages & Frameworks.
  2. In the PHP page that opens, choose the PHP 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.
    • 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 Interpreters dialog box are not listed.
  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

Last modified: 13 July 2016