Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel - Composer detected issues in your platform after updating it

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?

like image 937
ravexu Avatar asked Dec 04 '20 12:12

ravexu


People also ask

How to fix laravel site composer detected issues on your platform?

Just run this command. composer install –ignore-platform-reqs and second solution is First of all In you project you can check the platform check file your-project-path/vendor/composer/platform_check. php $issues = array(); Then just remove extra code Or comment it. Add the platform check option in the composer.

How do you solve composer detected issues in your platform?

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3. 0". Solution: You could use the easiest way: add --ignore-platform-reqs option to composer install/composer update to ignore all platform requirements.


Video Answer


3 Answers

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.

like image 73
Hache_raw Avatar answered Oct 10 '22 06:10

Hache_raw


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.

like image 44
tread khuram Avatar answered Oct 10 '22 04:10

tread khuram


Please run this command:

composer install --ignore-platform-reqs

If you add the --ignore-platform-reqs option when running Composer update, it will ignore restrictions. Click here for more information.

like image 8
karnveersingh Avatar answered Oct 10 '22 05:10

karnveersingh