In a server we have a few of webapp and actually have both 7.2 and 7.4 installed.
When running composer install, it use the PHP setup as default in the system, actually the 7.4.
In fact,
$ which php
/usr/bin/php
$ php -v
PHP 7.4.2 (cli) ...
$ ls -la /usr/bin/php
lrwxrwxrwx 1 root root 21 Nov 20 11:20 /usr/bin/php -> /etc/alternatives/php
$ ls -la /etc/alternatives/php
lrwxrwxrwx 1 root root 15 Feb 12 11:08 /etc/alternatives/php -> /usr/bin/php7.4
The app were I must execute composer install
is a PHP 7.2, so I need the composer respect this.
I am sure it trying to use PHP 7.4 because it is complaining about php7.4-mbstring
missing. But it's installed and enabled for PHP 7.2.