title: How to specify to use a specific PHP version when running "composer install"?
body: <p>In a server we have a few of webapp and actually have both 7.2 and 7.4 installed.</p>
  
  <p>When running composer install, it use the PHP setup as default in the system, actually the 7.4.</p>
  
  <p>In fact, </p>
  
  <pre><code>$ 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 -&gt; /etc/alternatives/php
  
  $  ls -la /etc/alternatives/php
  lrwxrwxrwx 1 root root 15 Feb 12 11:08 /etc/alternatives/php -&gt; /usr/bin/php7.4
  </code></pre>
  
  <p>The app were I must execute <code>composer install</code> is a PHP 7.2, so I need the composer respect this.</p>
  
  <p>I am sure it trying to use PHP 7.4 because it is complaining about <code>php7.4-mbstring</code> missing. But it's installed and enabled for PHP 7.2. </p>