Install Laravel 7 error mockery/mockery [Solved]

I tried installing laravel version 7. Then got an error message like the following

Crafting application...
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 mockery/mockery 1.4.0 -> satisfiable by mockery/mockery[1.4.0].
    - mockery/mockery 1.4.0 requires php ^7.3.0 -> your PHP version (7.2.23) does not satisfy that requirement.

Based on laravel 7 installation guide

Server Requirements

The Laravel framework has a few system requirements. All of these requirements are satisfied by the Laravel Homestead virtual machine, so it’s highly recommended that you use Homestead as your local Laravel development environment.

However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

  • PHP >= 7.2.5
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Solution

Your PHP version is too low. You’ve got 7.2.23 installed, and mockery/mockery 1.4 requires 7.3.0

The best solution is to upgrade your PHP version. Alternatively, you can reduce mockery’s version to 1.3.1, which only requires PHP 5.6 or above.


Leave a Reply