API Platform v1.1.1 and Symfony 3.2.8 composer conflict
My Symfony Demo Application is working and now I am trying to install the API framework as a separate bundle .
I am using PHP 7.0.10 with the latest composer, but my previous test was using PHP 5.6.20.
When I try to add the Platform Core API as a dependency, I get the following error:
$ composer require api-platform/core
Using version ^1.1 for api-platform/core
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/symfony (locked at v3.2.8, required as ^3
.2) -> satisfiable by symfony/symfony[v3.2.8].
- api-platform/core v1.1.0 requires phpdocumentor/reflection ^1.0.7 -> satis
fiable by phpdocumentor/reflection[1.0.7].
- api-platform/core v1.1.1 requires phpdocumentor/reflection ^1.0.7 -> satis
fiable by phpdocumentor/reflection[1.0.7].
- Conclusion: don't install phpdocumentor/reflection 1.0.7
- Installation request for api-platform/core ^1.1 -> satisfiable by api-plat
form/core[v1.1.0, v1.1.1].
Installation failed, reverting ./composer.json to its original content.
In your file composer.json
:
Search:
"symfony/symfony": "3.2.*",
Replaced by:
"symfony/symfony": "3.3.*",
... or:
"symfony/symfony": "^3.2.*",
You will most likely need (want to) run composer update
, then THEN add your api-platform package with composer require api-platform/core
so that you load all dependencies correctly, but this is not essential.
As of PHP 7.x, you should use ^2.0
eg.
composer require api-platform/core ^2.0
Note. To get around the PHP 7.x requirements, you can try adding --ignore-platform-reqs
.
If you get an error minimum-stability
, change it to beta
in the file composer.json
.
Source: Compatibility issue when using composer requires with symfony 3.1.4 on GitHub .
See: Installing the API Platform Platform .