framework: Problem with Doctrine instantiator

  • Laravel Version: 5.4.30
  • PHP Version: 7.0.15
  • Database Driver & Version: mysql 5.5

Description:

When trying to update with composer the following error occurs:

Problem 1
    - 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.15) does not satisfy that requirement.

It looks like this bug was introduced with the following PR: #20227

Steps To Reproduce:

run composer update

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 29
  • Comments: 31 (6 by maintainers)

Commits related to this issue

Most upvoted comments

The simple temporary solution until you update your server interpreted from http://doctrine-project.org/2017/07/25/php-7.1-requirement-and-composer.html :

  1. In your development folder, go to your composer.json. At the bottom of the file is a “config” option. Change it to this: “config”: { “preferred-install”: “dist”, “sort-packages”: true, “optimize-autoloader”: true, “platform”: {“php”: “[WHATEVER YOUR SERVER PHP VERSION IS E.G: 7.0]”} }
  2. Save file and run composer update
  3. Push new composer.lock file to your server
  4. Run composer install on your server

Meh you don’t need to do all that: just read this link

I think it’s a problem with phpunit, try ~5.7 or lower, but it should work on ~6.0 When installing on php7.0 it’s working for me.

you need doctrine/instantiator 1.0.5, i don’t know why it’s installing 1.1.0 when i’m doing this

composer require phpunit/phpunit-mock-objects 3.4.4 --update-with-dependencies
composer require doctrine/instantiator ^1.0.2 --update-with-dependencies

it’s working on 7.0, it’s installing doctrine/instantiator 1.0.5 , as expected.

I wish people would be sensitive to what platforms officially support PHP 7.1, forcing people to install unofficial repositories is frustrating. Even looking for a workaround is frustrating.

you can use platform.config to override your phpversion. delete old composer.lock if you have one or do composer update.

If you are using PHP 7.0 you don’t need to do anything. Since new minor version of doctrine package is PHP 7.1+, composer shouuld pick the earlier version directly unless there is a conflict with another dependency. Would advise you to seek help either on forums or slack channel.

I started a Laravel 5.4 project yesterday on my home pc with php 7.1 and checked out same on laptop with php 7.0. I ran into same error. I read the link but I am still not sure what is fix here, What should I add to my composer.json in order to just stick with php 7.0 please suggest.

@Dylan-DPC yeah that did it for me! Thanks a lot.

The problem is that doctrine decided to increase the minimum version in a minor release, all packages using the doctrine affected packages need to fix their version requirement on the previous minor to avoid such problems, we’ve done that for Laravel so far. Closing this since there’s nothing more we can do, all other packages has to do the same.