IntelliJ IDEA 2022.2 Help

Configure include paths

Include paths are used for holding third-party code that is used for completion and reference resolution in some functions/methods that use file paths as arguments, for example, require() or include().

Note that the files added via include paths are not meant to be edited within the scope of your project. If you have the existing code that you need to access and modify from within several projects, consider adding it via an additional content root.

Install the PHP plugin

This functionality relies on the PHP plugin that should be installed and enabled in your IDE.

The plugin is available only in IntelliJ IDEA Ultimate.

  1. Press Ctrl+Alt+S to open the IDE settings and select Plugins.

  2. Switch to the Marketplace tab and use the search field to find the PHP plugin.

  3. Click Install and restart the IDE if prompted.

Configure include paths

  1. Do one of the following:

    • To configure the include paths for the current project, in the Settings/Preferences dialog (Ctrl+Alt+S), click PHP under Languages & Frameworks.

    • To configure the include paths that will be applied to all newly created projects, use the default new project settings (File | New Projects Setup | Settings/Preferences for New Projects).

  2. On the PHP reference page that opens, configure the list of include paths on the Include path tab:

    • Use Add and Remove to add and remove paths.

    • Use Move up and Move down to reorder the items in the list.

    • Click the Sort Alphabetically button to sort the paths alphabetically in the ascending order.

Last modified: 29 November 2022