Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package laravel/ui at version has a PHP requirement incompatible with your PHP version (5.6.40)

Tags:

php

laravel

My problem is when I want to run command : composer require laravel/ui --dev i get an error with title : [InvalidArgumentException] and error message is :

Package laravel/ui at version has a PHP requirement incompatible with your PHP version (5.6.40)

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...`

NOTE : My PHP Version is : 7.4.3

like image 410
Matin Rezaii Avatar asked Feb 23 '20 11:02

Matin Rezaii


4 Answers

It seems that the composer is using an old PHP version on your system, try to reconfigure it using this command:

composer config platform.php 7.4.3
like image 164
Hafez Divandari Avatar answered Nov 11 '22 20:11

Hafez Divandari


I had this error with some other package installations on my local version (my local php version differed from the one on server) so I just ran:

composer require "some/other-package:^1.0" --ignore-platform-reqs

and all is fine now.

like image 25
Mehrdad Dehghani Avatar answered Nov 11 '22 21:11

Mehrdad Dehghani


This error comes due to compatible version in your composer.json file. To permanently fix this issue, change the composer.json file "platform" configuration:

"platform": {
            "php": "7.4.3"
 }

Then execute composer install

like image 22
Sehdev Avatar answered Nov 11 '22 21:11

Sehdev


2021 Dec

if being supposed to install "laravel/ui" naturally it would claim for matching php version because current ui level is 3.3.0 and php's is 8.0.2 (or so, not sure). Thus what you re going to console next is:

composer update      //in case you corrupted something 
composer require laravel/ui:^3.3.0
like image 1
CodeToLife Avatar answered Nov 11 '22 20:11

CodeToLife