skip to Main Content

when I check my PHP version it shows 8.0.3 but I changed the version to 7.2.0 in Laragon.
when I run the composer update command in Laravel it generates the error

Problem 1

  • Root composer.json requires PHP ^7.2.0 but your PHP version (8.0.3) does not satisfy that requirement.

Problem 2

  • laravel/framework[v5.8.0, …, 5.8.x-dev] require php ^7.1.3 -> your php version (8.0.3) does not satisfy that requirement.
  • Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, …, 5.8.x-dev].

2

Answers


  1. This is a common problem in PHP because your PHP version does not match Laravel or the packages you use. Now it’s better to go to the composer.json file that says the last version you can have this way.

    "require": {
        "php": "^ 8.0.2",
    

    For example, in Laravel version 9, the minimum PHP version is 8.0.2

    Login or Signup to reply.
  2. In your command line type:

    composer require
    

    press enter and then it will ask for the package

    search for a package : php
    

    press enter and then it will ask for the version

    Enter the version constraint to require (or leave blank to use the latest version) : 7.1.3
    

    press enter twice. Hope this helps.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search