1

I have cloned the Laravel project and want to upgrade the PHP version in the Laravel project from 7.3 to 7.4. Because when I run composer install, it shows an error like this:

Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.24

I have installed PHP 7.4 on my laptop, when I check on terminal php -v it shows 7.4, but when I check php -v in laravel project it show 7.3. please anyone can tell me how to update the PHP version on the Laravel project.

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
j.me
  • 17
  • 3
  • it's not related to the laravel project. you have two php installation, CLI and FPM, CLI is for console commands. Check you vhost file if the version is pecified there. If not , we need more details about your installation and the server you are using. Or bypass the composer error as the asnwer shows you. – N69S Aug 20 '21 at 13:43

1 Answers1

0

Run on your terminal:

sudo update-alternatives --config php

Then select the version you want to use

Switch php versions on commandline ubuntu 16.04

Lorenzo Mogicato
  • 138
  • 1
  • 11