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

与世无争的帅哥 提交于 2021-01-27 19:26:45

问题


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


回答1:


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



回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/60361906/package-laravel-ui-at-version-has-a-php-requirement-incompatible-with-your-php-v

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!