Laravel - Composer detected issues in your platform after updating it
Solution 1
Your terminal user's PHP version may differ from the server's version.
You may have 7.4.13 on terminal while having a completely different PHP version in apache2 or whatever server you are using.
Use phpinfo();
in a PHP file and access it via browser to see the actual PHP version.
Solution 2
Here is quick solution that work for me
In you project you can check the platform check file projec-path/vendor/composer/platform_check.php
$issues = array();
after this Remove or comment the extra code
Add the platform check option in the composer.json config section like this.
"config": { "platform-check": false },
After that, you need to run
composer update
After the composer update platform_check.php will be deleted and project work fine.
Solution 3
Please run this command:
composer install --ignore-platform-reqs
Solution 4
I ran into this issue after installing a new version of PHP on a server using IIS. Not realizing that IIS didn't support verbs like UPDATE/PATCH out of the box, and these methods were being utilized by the website. When a route was accessed via PATCH for instance, the new version of PHP was not handling that, so it fell-back to the old version of PHP -- and that's when this error presented itself.
Resolving it was simply a matter of editing the Handler Mappings in IIS. I found the mapping that would point *.php files to my new version of PHP, and customized it so that it would support other verbs like PATCH
Related videos on Youtube
ravexu
Updated on October 01, 2021Comments
-
ravexu over 2 years
So i just updated composer using the command
composer self-update --2
, However, now my web application shows the errorComposer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".
I dont understand this because doing
php -v
gives me PHP 7.4.13How can I fix this?
-
Shurvir Mori over 2 yearsShort answer : add
--ignore-platform-reqs
after any command, in My case,composer create-project
casuses issues, butcomposer create-project --ignore-platform-reqs
runs well
-
-
ravexu over 3 yearsYou were correct. Thanks a lot. The nginx conf file had php7.2 fpm
-
Eduardo about 3 yearsI did this and the printed version was 7.4.14 however this is the message I get:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.25
where else could I look? -
Hache_raw about 3 years@Eduardo I think your case is the opposite: do a php -v on terminal and if it prints 7.3.25 you'll have to change the terminal user's php version
-
Eduardo about 3 years@Hache_raw that outputs 7.4
-
Hache_raw about 3 yearsNot a real solution but if you are sure your server is running the required version you can try
composer install --ignore-platform-reqs
-
east1000 over 2 yearsThis does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
-
Nico Haase over 2 yearsPlease add some explanation to your answer such that others can learn from it. Also, please mention the possible consequences of using that option
-
karnveersingh over 2 years@NicoHaase i guess you are right. Here is the explanation. if you add the --ignore-platform-reqs option when you run composer update, it will ignore restrictions. Please refer this for more information -: hannesvdvreken.com/2015/01/18/…
-
Nico Haase over 2 yearsPlease add all explanation to your answer instead of linking to external ressources
-
Nico Haase over 2 yearsUpdate it to which version? If anything later than 7.3 is required and currently PHP 7.4.13 is used, this looks like a different error. Also, what if the OP doesn't even use cpanel?
-
ymakux over 2 yearsso stupid fix, lol
-
deemi-D-nadeem over 2 yearsFixed my issue. thanx alot ;)