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?
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.
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
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.
Just update your version of PHP in cpanel. I ran into the same issues and this helped me.
Please run this command:
composer install --ignore-platform-reqs