Search code examples
laravelcomposer-php

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5"


I'm trying to upload a plain laravel v5.8 project to a server. It gives me this error

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.5".

I updated the Laravel version to v6 and it still throws the same thing.

Is there any possible solution I tried many but nothing happens. Thanks in advance.


Solution

  • I faced this problem using the new version of composer, didn't have seen this issue before, although this question is a bit old the solution can help someone else.

    I did this working in a development machine, if you really need to change the PHP version running in your server this isn't for you.

    This problem is related to a composer configuration when you run the command "composer install" if you need to work with the configuration you already have and don't want to make changes which could lead to other problems you should:

    1. remove the packages you already have installed which includes this configuration from composer

    sudo rm -r vendor

    1. run the command again with this flag: --ignore-platform-reqs

    composer install --ignore-platform-reqs

    Now composer won't perform this check anymore and you are good to go!