PhpStorm 2018.1 Help

Composer

File | Settings | Languages and Frameworks | PHP | Composer for Windows and Linux
PhpStorm | Preferences | Languages and Frameworks | PHP | Composer for macOS
Ctrl+Alt+S

settings

On this page, enable execution of Composer Dependency Manager commands through the dedicated user interface and appoint the default composer.json for the PhpStorm project.

ItemDescription
Path to composer.json In this text box, specify the location of the composer.json that you want to use as default. All the Composer commands invoked from Tools | Composer on the main menu will be executed in accordance with the settings from this configuration file.

You can have several composer.json files in one PhpStorm project. For each composer.json, actions are invoked from its context menu in the editor or in the Project view, or using the shortcut links on top of the editor panel.

Add packages as libraries Use this checkbox to configure the open-for-edit status of Composer packages. To protect packages under vendor/*/* against editing, leave the checkbox selected (this is the default setting).

If you want to edit the Composer packages under vendor/*/*, clear the checkbox.

Synchronize IDE settings with composer.json Select this checkbox to automatically detect the PHP language level and configure project Source and Test roots based on the configuration from composer.json.

PhpStorm is aware of PSR-0/PSR-4 source roots and of their namespace prefixes declared in the autoload and autoload-dev sections in composer.json. PhpStorm also detects the PHP language level based on the php setting in the require section.

Because composer.json contains the most up-to-date information about the project configuration, this automatic synchronization ensures that the Source and Test folder exactly match the project structure and the correct PHP language level is set automatically.

To learn more about PSR and autoloading, refer to the Composer official website. For examples and details on synchronizing settings, refer to the PhpStorm blog post.

PHP interpreter Choose one of the configured PHP interpreters from the list. See Configuring Remote PHP Interpreters for details.
Path to composer.phar In this text box, specify the location of the composer.phar archive.
Click here to download from getcomposer.org Click this link to download composer.phar from the official storage and specify the folder to store the archive in. This instance of Composer will be available in the current project only. To use it in the command line mode, configure it as a command line tool.
Last modified: 27 July 2018

See Also