title: Unable to change PHP version in Ubuntu 18.04 terminal
body: <p>This question has been asked multiple times but non of them worked for me. I need to change my terminal's version to 7.4.</p>
  <p>When I do <code>phpinfo()</code> it gives <strong>7.4.10</strong> but in terminal <code>php -v</code> it always show <strong>5.6.0</strong></p>
  <p>I've done:</p>
  <pre><code>$ sudo a2dismod php5.6
  $ sudo a2enmod php7.4
  $ sudo service apache2 restart
  
  set PATH=&quot;/usr/bin/php7.4/bin:$PATH&quot;
  
  sudo update-alternatives --set php /usr/bin/php7.4
  sudo update-alternatives --set phar /usr/bin/phar7.4
  sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
  
  sudo update-alternatives --config php
  </code></pre>
  <p>This show below result:</p>
  <p><a href="https://i.stack.imgur.com/DdPsL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DdPsL.png" alt="PHP version" /></a></p>