Laravel - Composer detected issues in your platform after updating it

41,929

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

  1. 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

  1. 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

Share:
41,929

Related videos on Youtube

ravexu
Author by

ravexu

Updated on October 01, 2021

Comments

  • ravexu
    ravexu over 2 years

    So i just updated composer using the command composer self-update --2, However, now my web application shows the error Composer 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.13

    How can I fix this?

    • Shurvir Mori
      Shurvir Mori over 2 years
      Short answer : add --ignore-platform-reqs after any command, in My case, composer create-project casuses issues, but composer create-project --ignore-platform-reqs runs well
  • ravexu
    ravexu over 3 years
    You were correct. Thanks a lot. The nginx conf file had php7.2 fpm
  • Eduardo
    Eduardo about 3 years
    I 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
    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
    Eduardo about 3 years
    @Hache_raw that outputs 7.4
  • Hache_raw
    Hache_raw about 3 years
    Not a real solution but if you are sure your server is running the required version you can try composer install --ignore-platform-reqs
  • east1000
    east1000 over 2 years
    This 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
    Nico Haase over 2 years
    Please add some explanation to your answer such that others can learn from it. Also, please mention the possible consequences of using that option
  • karnveersingh
    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
    Nico Haase over 2 years
    Please add all explanation to your answer instead of linking to external ressources
  • Nico Haase
    Nico Haase over 2 years
    Update 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
    ymakux over 2 years
    so stupid fix, lol
  • deemi-D-nadeem
    deemi-D-nadeem over 2 years
    Fixed my issue. thanx alot ;)

Related