0

I recently installed php (8.1.7) and composer (2.3.7) and laravel 9; Now I am getting this error while running the command composer update on a laravel project, I searched a lot but couldn't find exact solution, all of them were not discussing the issue of phpunit/phpunit.

The error looks like this:


  Problem 1
    - phpunit/phpunit[6.0.0, ..., 6.5.14] require php ^7.0 -> your php version (8.1.7) does not satisfy that requirement.
    - Root composer.json requires phpunit/phpunit ~6.0 -> satisfiable by phpunit/phpunit[6.0.0, ..., 6.5.14].```
  • 1
    Just read! `require php ^7.0 -> your php version (8.1.7) does not satisfy that requirement.`, means you need any version of PHP 7.x instead of PHP 8.1.7. – Markus Zeller Jun 23 '22 at 07:07
  • Does this answer your question? [Reference - Composer error "Your PHP version does not satisfy requirements" after upgrading PHP](https://stackoverflow.com/questions/66368196/reference-composer-error-your-php-version-does-not-satisfy-requirements-afte) – Nico Haase Jun 23 '22 at 12:31

1 Answers1

2

You have to upgrade your phpunit version to correspond with your php 8.1.7 (choose between phpunit version 9 or 8, according to the official documentation) or downgrade your php version to works with phpunit 6.*.

That's it !

vinceAmstoutz
  • 676
  • 1
  • 4
  • 18