I was trying to install Magento 2.4via SSH and when I get to the composer part I get an error that my PHP is 7.2 but I use 7.4 as SSH says as well as my host Cpanel.
Here is the code I got from SSH
PS: I have contacted the hosting provider (BlueHost) and they say I use 7.4 as well as when u used PHP -v at SSH panel it says the same that I use 7.4
Seems like your composer is using other php version, you can use php 7.4 like below :
/usr/bin/php7.4 /usr/local/bin/composer install
if it can't read file from /usr/bin/php7.4, then run :
then use that path before your command, hope it helps !