{"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

$ sudo apt update\n$ sudo apt install software-properties-common\n$ sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\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

$ 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

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

$ sudo systemctl status php8.0-fpm\n$ sudo systemctl status php7.4-fpm<\/code><\/pre>\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

##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":"

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":"\nHow to Install Multiple PHP Versions in Ubuntu 20.04 LTS<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-28T23:08:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-04T05:17:28+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS\",\"datePublished\":\"2021-01-28T23:08:55+00:00\",\"dateModified\":\"2021-12-04T05:17:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\"},\"wordCount\":221,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg\",\"keywords\":[\"Cross Platform\",\"Linux\",\"Open Source\",\"Optimization\",\"PHP\",\"Server\",\"Ubuntu\",\"Web\",\"Web Applications\"],\"articleSection\":[\"Articles\",\"Guides\",\"How To\",\"Libraries\",\"Software\",\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\",\"url\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\",\"name\":\"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg\",\"datePublished\":\"2021-01-28T23:08:55+00:00\",\"dateModified\":\"2021-12-04T05:17:28+00:00\",\"description\":\"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Install Multiple PHP Versions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS","description":"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS","og_description":"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system","og_url":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2021-01-28T23:08:55+00:00","article_modified_time":"2021-12-04T05:17:28+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS","datePublished":"2021-01-28T23:08:55+00:00","dateModified":"2021-12-04T05:17:28+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/"},"wordCount":221,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg","keywords":["Cross Platform","Linux","Open Source","Optimization","PHP","Server","Ubuntu","Web","Web Applications"],"articleSection":["Articles","Guides","How To","Libraries","Software","Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/","url":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/","name":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg","datePublished":"2021-01-28T23:08:55+00:00","dateModified":"2021-12-04T05:17:28+00:00","description":"This tutorial will show you how to install multiple PHP versions on a single Ubuntu 20.04 LTS or similar Linux system","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/install-multiple-php-versions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/01\/Install-Multiple-PHP-Versions.jpg","width":1200,"height":630,"caption":"Install Multiple PHP Versions"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/install-multiple-php-versions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Install Multiple PHP Versions in Ubuntu 20.04 LTS"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/9588"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=9588"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/9588\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/9589"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=9588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=9588"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=9588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}