doctrine/dbal v2.5.11 has the following requirements:
php: >=5.3.2
doctrine/common: >=2.4,<2.8-dev
But doctrine/common v2.7 requires php: ~5.6|~7.0 and v2.6 requires php: ~5.5|~7.0.
I think doctrine/dbal v2.5 should either also require at least php 5.6, or it should not allow doctrine/common v2.7 to be installed as v2.5 is the last version to also have php 5.3 as a version constraint.
Because of this, the following error is occurring during composer install
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/annotations v1.3.1 -> satisfiable by doctrine/annotations[v1.3.1].
- doctrine/annotations v1.3.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.30) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/collections v1.4.0 -> satisfiable by doctrine/collections[v1.4.0].
- doctrine/collections v1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.30) does not satisfy that requirement.
Problem 3
- Installation request for doctrine/common v2.7.2 -> satisfiable by doctrine/common[v2.7.2].
- doctrine/common v2.7.2 requires php ~5.6|~7.0 -> your PHP version (5.5.30) does not satisfy that requirement.
Problem 4
- doctrine/common v2.7.2 requires php ~5.6|~7.0 -> your PHP version (5.5.30) does not satisfy that requirement.
- doctrine/dbal v2.5.11 requires doctrine/common >=2.4,<2.8-dev -> satisfiable by doctrine/common[v2.7.2].
- Installation request for doctrine/dbal v2.5.11 -> satisfiable by doctrine/dbal[v2.5.11].
v2.5 should either also require at least php 5.6
Not possible, since otherwise users of the package wouldn't get patch releases.
As our travis builds already show, installing this package on PHP 5.3.3+ is allowed. Everything else is stricter constraints on your side.
I see, I think I know where it went wrong.
The PHP version used to make the composer.lock file, caused the versions to be set to the ones shown in the error.
So when composer install is run on PHP 5.5 (or lower) now, it's trying to install those same versions that require at least 5.6.
The PHP version used to make the composer.lock file, caused the versions to be set to the ones shown in the error.
So when composer install is run on PHP 5.5 (or lower) now, it's trying to install those same versions that require at least 5.6.
I can confirm this. This is pretty inconvenient when you use something like envoyer where it only runs composer install by default.
Or am I missing something here? Should we not be committing the lock file?
@reilg you should commit the lock file, and you can set the PHP version in composer.json to make composer use that to create the lock file.
@lcobucci thank you. I did _not_ know about that. That is pretty nifty.
Sometimes after updating php also if you are getting same error then please delete composer.lock file.
Most helpful comment
@reilg you should commit the lock file, and you can set the PHP version in composer.json to make composer use that to create the lock file.