{"id":9588,"date":"2021-01-28T18:08:55","date_gmt":"2021-01-28T23:08:55","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=9588"},"modified":"2021-12-04T05:17:28","modified_gmt":"2021-12-04T05:17:28","slug":"install-multiple-php-versions","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/","title":{"rendered":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS"},"content":{"rendered":"\n
This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system.<\/p>\n\n\n\n
First, we will need to add the requisite Personal Package Archive (PPA). PPAs are software repositories designed for Ubuntu<\/a> users and are easier to install than other third-party repositories. PPAs are often used to distribute pre-release software so that it can be tested or the latest packages are not available in the default repositories.<\/p>\n\n\n\n A PPA is maintained for PHP<\/a> installation on Ubuntu systems so we will use the commands below to add the PPA to your system.<\/p>\n\n\n\n For this tutorial, we will be adding PHP 8.0 and PHP 7.4 using the following commands:<\/p>\n\n\n\n After installation, PHP-fpm<\/strong> services will be started automatically. Use the following commands to make sure both services are running.<\/p>\n\n\n\n Congratulations! You now have two versions of PHP on your Ubuntu system. That’s not all, you may want to follow this tutorial to see how to install PHP modules for each of these versions.<\/p>\n\n\n\n If you are configuring Apache with PHP then all you would need to do is point to the right php.ini<\/em> file for the appropriate version as shown in this post<\/a>.<\/p>\n\n\n\n For the above installations, these would usually be the locations of the php.ini<\/em> files:<\/p>\n\n\n\n This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system. First, we will need to add the requisite Personal…<\/p>\n","protected":false},"author":1,"featured_media":9589,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,25,28,16],"tags":[164,354,424,433,452,531,598,635,636],"yoast_head":"\n$ sudo apt update\n$ sudo apt install software-properties-common\n$ sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\n\n\n\n
$ sudo apt update -y\n$ sudo apt install php8.0 php8.0-fpm -y\n$ sudo apt install php7.4 php7.4-fpm -y<\/code><\/pre>\n\n\n\n
$ sudo systemctl status php8.0-fpm\n$ sudo systemctl status php7.4-fpm<\/code><\/pre>\n\n\n\n
##PHP 8.0\n\/etc\/php\/8.0\/fpm\/php.ini\n\n##PHP 7.4\n\/etc\/php\/7.4\/fpm\/php.ini<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"