Skip to content

PHP version not updated in symfony.lock after installing with Composer v2 #708

@lchrusciel

Description

@lchrusciel

With composer v1, when one was installing the current project, but symfony.lock was generated with a different PHP version, flex was able to update this value. After bumping composer to v2 this feature does not work anymore. This leads to surprising exceptions like:

Fatal Error: composer.lock was created for PHP version 7.X or higher but the current PHP version is 7.Y

Where X > Y, but both are correct according to composer.json.

How to reproduce?

  1. Have symfony.lock generated with a higher version of PHP that your current runtime
  2. Have composer v2
  3. Run composer install/update
  4. Exception will be thrown with any Symfony command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions