You will have lot of problems when your local development PHP version might be different then that of production PHP version, this might further cause some issues when you run composer commands.

Not only this if you need to upgrade your PHP frameworks like LARAVELSYMFONY you have to install newer version of PHP. You might also upgrade because fo security patches. So in this tutorial I will teach you how to install multiple PHP versions and how to switch to different PHP version as per your requirements.


Step 1 - Update OS Packages & Install Libraries

First login to your server and update the Ubuntu/Linux packages with the following command

sudo apt-get update

You can check if you had earlier installed PHP by using the following command. It will list the PHP version installed

sudo php -v

You might need to install additional packages like PPA, if your operating system has not yet released the PHP version your looking out for then 3rd party PPA Ondrej will help to download the latest one.

#ubuntu #php #packages #libraries

How To Switch Different PHP Versions In Ubuntu
1.25 GEEK