When you restart phpStorm and open the project, the composer stops working. Every time you have to re-open Tools / Composer / Init composer and specify the path to php.exe and composer.path . This problem is observed when opening only some projects. Tell me what could be the problem?

phpStorm 10.0.3

  • one
    to you in technical support - etki
  • By the way, the technical support of JetBrains is at its height. Any comments on Twitter are answered promptly and the bug tracker their norms work - strangeqargo

2 answers 2

In order for the composer settings to work, the following 2 simple conditions must be met.

  1. It is necessary that the PHP interpreter be configured: Languages & Frameworks/PHP Interpreter (select the PHP php.exe executable file) just above the PHP language level must match the version of the selected interpreter.
  2. Actually, set up the composer itself. For this:
    • it must be available in the project: either installed globally, or the composer.phar file must be in the project folder. For global configuration, make sure that the composer command in the console displays a list of commands.
    • specify the path to the composer.phar file used, either globally accessible or locally installed in the project.

Possible problems:

  1. Composer file is not available for your project. Make sure that the composer for global configuration or php composer.phar for local is available in the folder of your project.
  2. In the settings of PhpStorm, it is NOT the composer.phar file that is available in your project.
  3. PhpStorm stores the local settings of the project in the .idea folder. Make sure that you do not overwrite, delete or change this folder for your project upon reload. Also make sure that the project path is correct and has not been changed upon reboot.

In the end I want to say that you are very limiting the answers to your question, initially narrowing them down to the part that did not bring you a positive result. It would be better if you asked how to implement exactly what you need. For example, how to install a new package in a project using a composite? Perhaps, and most likely, there are more simple ways to solve your problem, which you simply do not know.

    This is the "feature" of the composer settings through " Tools / Composer / Init composer ". Configure the composer in the project manually.

    1. Open the " File / Settings " settings
    2. Go to " Languages ​​& Frameworks / PHP "
    3. Choose php interpreter
    4. Go to " Languages ​​& Frameworks / PHP / Composer "
    5. Enter the path to composer.phar and comopser.json
    • Made by The result is the same, unfortunately. - LANSELOT
    • Check whether the composer settings are saved in the file "<project> /. Idea / workspace.xml" <component name="ComposerSettings"> <pharConfigPath>path/to/composer.json</pharConfigPath> <pharPath>path/to/composer.phar</pharPath> </component> @LANSELOT - Alexander Andreev