Error with composer installing a Laravel 5.5 application in a Debian 9 with PHP 7.0

Installing a new Laravel 5.5 application in a Debian 9 with PHP 7.0.27, when I execute the “composer install” I get this error:

$ 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 symfony/event-dispatcher v4.0.1 -> satisfiable by symfony/event-dispatcher[v4.0.1].
- symfony/event-dispatcher v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.27) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.27) does not satisfy that requirement.
Problem 3
- symfony/event-dispatcher v4.0.1 requires php ^7.1.3 -> your PHP version (7.0.27) does not satisfy that requirement.
- symfony/http-kernel v3.4.1 requires symfony/event-dispatcher ~2.8|~3.0|~4.0 -> satisfiable by symfony/event-dispatcher[v4.0.1].
- Installation request for symfony/http-kernel v3.4.1 -> satisfiable by symfony/http-kernel[v3.4.1].

I solve this problem adding this line to the composer.json  file

"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true,
    "platform":{"php":"7.0"}
}

and then executing

$ composer update

 

Leave a Reply

Your email address will not be published. Required fields are marked *