{"id":9872,"date":"2025-02-20T03:46:13","date_gmt":"2025-02-20T03:46:13","guid":{"rendered":"https:\/\/www.magetop.com\/blog\/?p=9872"},"modified":"2025-02-20T03:51:35","modified_gmt":"2025-02-20T03:51:35","slug":"how-to-install-multiple-php-versions-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/","title":{"rendered":"How To Install Multiple PHP Versions On Ubuntu"},"content":{"rendered":"\n<p>Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you <strong>How To Install Multiple PHP Versions On Ubuntu<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps To Install Multiple PHP Versions On Ubuntu<\/h2>\n\n\n\n<p><strong>Step 1:<\/strong> Add the Required Repository<\/p>\n\n\n\n<p>Ubuntu does not provide multiple PHP versions by default. You need to add the <strong>Ond\u0159ej Sur\u00fd PPA<\/strong>, which maintains up-to-date PHP packages:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo add-apt-repository ppa:ondrej\/php\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt update\n<\/pre><\/div>\n\n\n<p><strong>Step 2:<\/strong> Install Multiple PHP Versions<\/p>\n\n\n\n<p>To install specific PHP versions, use the following commands:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt install php&lt;--php-version--&gt;\n<\/pre><\/div>\n\n\n<p>Replace the versions with the ones you need.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt install php8.1 php8.3\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Configure PHP Version Switching<\/h2>\n\n\n\n<p>To switch between installed PHP versions, use the <code>update-alternatives<\/code> command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo update-alternatives --set php \/usr\/bin\/php8.3\n<\/pre><\/div>\n\n\n<p>Alternatively, use:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo update-alternatives --config php\n<\/pre><\/div>\n\n\n<p>This command will prompt you to select the desired PHP version.<\/p>\n\n\n\n<p>If using <strong>Apache<\/strong>, enable the required PHP module:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo a2dismod php8.1\nsudo a2enmod php8.3\nsudo systemctl restart apache2\n<\/pre><\/div>\n\n\n<p>For <strong>Nginx<\/strong>, update your <code>server<\/code> block to point to the correct PHP version.<\/p>\n\n\n\n<p>Check your default PHP versions with command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp -v\n<\/pre><\/div>\n\n\n<p>If you don&#8217;t want to waste time setting default PHP Version, you can use the form below to run the command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp&lt;--php-version--&gt; &lt;--your-command--&gt;\n<\/pre><\/div>\n\n\n<p>For example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp8.3 -v\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"292\" data-attachment-id=\"9877\" data-permalink=\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/anh-man-hinh-2025-02-20-luc-10-28-56\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?fit=1202%2C439&amp;ssl=1\" data-orig-size=\"1202,439\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"A\u0309nh ma\u0300n hi\u0300nh 2025-02-20 lu\u0301c 10.28.56\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?fit=300%2C110&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?fit=800%2C292&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?resize=800%2C292&#038;ssl=1\" alt=\"Run Multiple PHP Versions On Ubuntu\" class=\"wp-image-9877\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?resize=1024%2C374&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?resize=300%2C110&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?resize=768%2C280&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/Anh-man-hinh-2025-02-20-luc-10.28.56.png?w=1202&amp;ssl=1 1202w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Installing and managing multiple PHP versions on Ubuntu allows greater flexibility in development environments. By following these steps, you can seamlessly switch between different PHP versions and ensure compatibility with various applications.<\/p>\n\n\n\n<p>This is the end of the&nbsp;<strong>How To Install Multiple PHP Versions On Ubuntu<\/strong>.<\/p>\n\n\n\n<p>Follow us for the more helpful posts!<\/p>\n\n\n\n<p>We hope this is a useful post for you.<\/p>\n\n\n\n<p>You can read more useful posts like\u00a0<strong><strong><a href=\"https:\/\/www.magetop.com\/blog\/how-to-set-automatic-backup-in-magento-2\/\">How To Set Automatic Backup In Magento 2<\/a><\/strong><\/strong>.<\/p>\n\n\n\n<p>Thank you for reading!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting<\/p>\n","protected":false},"author":106,"featured_media":9879,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[2225,2224,2222,2226],"class_list":["post-9872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-2-tutorials","tag-configure-multiple-php-versions-on-ubuntu","tag-install-multiple-php-versions-on-ubuntu","tag-multiple-php-versions","tag-php-versions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Install Multiple PHP Versions On Ubuntu - Magetop Blog<\/title>\n<meta name=\"description\" content=\"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\" \/>\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 On Ubuntu - Magetop Blog\" \/>\n<meta property=\"og:description\" content=\"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Magetop Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-20T03:46:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-20T03:51:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1355\" \/>\n\t<meta property=\"og:image:height\" content=\"753\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aaron LX\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:site\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aaron LX\" \/>\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\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\"},\"author\":{\"name\":\"Aaron LX\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\"},\"headline\":\"How To Install Multiple PHP Versions On Ubuntu\",\"datePublished\":\"2025-02-20T03:46:13+00:00\",\"dateModified\":\"2025-02-20T03:51:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\"},\"wordCount\":272,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1\",\"keywords\":[\"Configure Multiple PHP Versions On Ubuntu\",\"Install Multiple PHP Versions On Ubuntu\",\"Multiple PHP Versions\",\"PHP Versions\"],\"articleSection\":[\"Magento 2 Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\",\"url\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\",\"name\":\"How To Install Multiple PHP Versions On Ubuntu - Magetop Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1\",\"datePublished\":\"2025-02-20T03:46:13+00:00\",\"dateModified\":\"2025-02-20T03:51:35+00:00\",\"description\":\"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1\",\"width\":1355,\"height\":753,\"caption\":\"How To Install Multiple PHP Versions On Ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.magetop.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Install Multiple PHP Versions On Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"name\":\"Magetop Blog\",\"description\":\"Exploring Magento Tips, Tricks, and Trends\",\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.magetop.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\",\"name\":\"Magetop.com\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"width\":475,\"height\":475,\"caption\":\"Magetop.com\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/x.com\/MagetopStore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\",\"name\":\"Aaron LX\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"caption\":\"Aaron LX\"},\"description\":\"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.\",\"url\":\"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Install Multiple PHP Versions On Ubuntu - Magetop Blog","description":"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.","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":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How To Install Multiple PHP Versions On Ubuntu - Magetop Blog","og_description":"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.","og_url":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/","og_site_name":"Magetop Blog","article_publisher":"https:\/\/www.facebook.com\/MagetopStore","article_published_time":"2025-02-20T03:46:13+00:00","article_modified_time":"2025-02-20T03:51:35+00:00","og_image":[{"width":1355,"height":753,"url":"https:\/\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png","type":"image\/png"}],"author":"Aaron LX","twitter_card":"summary_large_image","twitter_creator":"@MagetopStore","twitter_site":"@MagetopStore","twitter_misc":{"Written by":"Aaron LX","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/"},"author":{"name":"Aaron LX","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7"},"headline":"How To Install Multiple PHP Versions On Ubuntu","datePublished":"2025-02-20T03:46:13+00:00","dateModified":"2025-02-20T03:51:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/"},"wordCount":272,"commentCount":0,"publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1","keywords":["Configure Multiple PHP Versions On Ubuntu","Install Multiple PHP Versions On Ubuntu","Multiple PHP Versions","PHP Versions"],"articleSection":["Magento 2 Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/","url":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/","name":"How To Install Multiple PHP Versions On Ubuntu - Magetop Blog","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1","datePublished":"2025-02-20T03:46:13+00:00","dateModified":"2025-02-20T03:51:35+00:00","description":"Managing multiple PHP versions on Ubuntu is essential for developers working with different applications requiring specific PHP versions. By setting up multiple PHP versions, you can easily switch between them without conflicts. This guide will show you How To Install Multiple PHP Versions On Ubuntu.","breadcrumb":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#primaryimage","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1","width":1355,"height":753,"caption":"How To Install Multiple PHP Versions On Ubuntu"},{"@type":"BreadcrumbList","@id":"https:\/\/www.magetop.com\/blog\/how-to-install-multiple-php-versions-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.magetop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Install Multiple PHP Versions On Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.magetop.com\/blog\/#website","url":"https:\/\/www.magetop.com\/blog\/","name":"Magetop Blog","description":"Exploring Magento Tips, Tricks, and Trends","publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.magetop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.magetop.com\/blog\/#organization","name":"Magetop.com","url":"https:\/\/www.magetop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","width":475,"height":475,"caption":"Magetop.com"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MagetopStore","https:\/\/x.com\/MagetopStore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA"]},{"@type":"Person","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7","name":"Aaron LX","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","caption":"Aaron LX"},"description":"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.","url":"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-Multiple-PHP-Versions-On-Ubuntu.png?fit=1355%2C753&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/paOdw5-2ze","jetpack-related-posts":[{"id":10777,"url":"https:\/\/www.magetop.com\/blog\/how-to-install-new-relic-apm-on-ubuntu\/","url_meta":{"origin":9872,"position":0},"title":"How To Install New Relic APM On Ubuntu","author":"Aaron LX","date":"October 16, 2025","format":false,"excerpt":"New Relic APM on Ubuntu helps Magento 2 developers and store owners monitor performance, track slow transactions, and optimize PHP applications in real time. In this guide, you\u2019ll learn how to install New Relic APM on Ubuntu using the official package repository for a clean and reliable setup. Steps To\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Install New Relic APM On Ubuntu","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/How-To-Install-New-Relic-APM-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/How-To-Install-New-Relic-APM-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/How-To-Install-New-Relic-APM-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/How-To-Install-New-Relic-APM-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/10\/How-To-Install-New-Relic-APM-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":9819,"url":"https:\/\/www.magetop.com\/blog\/how-to-install-phpmyadmin-on-ubuntu\/","url_meta":{"origin":9872,"position":1},"title":"How To Install phpMyAdmin On Ubuntu","author":"Aaron LX","date":"February 11, 2025","format":false,"excerpt":"phpMyAdmin is a free, open-source tool used to manage MySQL and MariaDB databases through a web-based interface. Written in PHP, it allows users to perform a wide range of database operations, including creating, modifying, and deleting databases, tables, and records. Please follow the post\u00a0How To Install phpMyAdmin On Ubuntu to\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Install phpMyAdmin On Ubuntu","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-phpMyAdmin-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-phpMyAdmin-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-phpMyAdmin-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-phpMyAdmin-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/02\/How-To-Install-phpMyAdmin-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":5476,"url":"https:\/\/www.magetop.com\/blog\/install-magento-2-4-7-on-ubuntu\/","url_meta":{"origin":9872,"position":2},"title":"How To Install Magento 2.4.7 On Ubuntu","author":"Aaron LX","date":"May 14, 2021","format":false,"excerpt":"Magento 2.4.7 has been released with hundreds of quality fixes and enhancements, enhancing GraphQL coverage for custom attributes and resolver caches. Please follow the post\u00a0How To Install Magento 2.4.7 On Ubuntu to install it successfully.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Install Magento 2.4.7 On Ubuntu","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/How-To-Install-Magento-2.4.7-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/How-To-Install-Magento-2.4.7-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/How-To-Install-Magento-2.4.7-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/How-To-Install-Magento-2.4.7-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/How-To-Install-Magento-2.4.7-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":10049,"url":"https:\/\/www.magetop.com\/blog\/how-to-install-mariadb-on-ubuntu\/","url_meta":{"origin":9872,"position":3},"title":"How To Install MariaDB On Ubuntu","author":"Aaron LX","date":"April 3, 2025","format":false,"excerpt":"MariaDB is a popular, open-source relational database management system that is a fork of MySQL. It is highly performant, secure, and compatible with most MySQL tools. In this guide, we will walk you through How To Install MariaDB On Ubuntu step by step. Steps To Install MariaDB On Ubuntu 1.\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/04\/How-To-Install-MariaDB-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/04\/How-To-Install-MariaDB-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/04\/How-To-Install-MariaDB-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/04\/How-To-Install-MariaDB-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/04\/How-To-Install-MariaDB-On-Ubuntu.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":10032,"url":"https:\/\/www.magetop.com\/blog\/how-to-configure-php-fpm-with-nginx\/","url_meta":{"origin":9872,"position":4},"title":"How To Configure PHP-FPM With Nginx","author":"Aaron LX","date":"March 27, 2025","format":false,"excerpt":"PHP-FPM (FastCGI Process Manager) is a powerful tool that improves PHP performance and resource management, making it ideal for high-traffic websites. When combined with Nginx, it ensures efficient request handling. In this guide, we\u2019ll show you how to configure PHP-FPM with Nginx for optimal performance. Unlike Apache, which traditionally uses\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Configure PHP-FPM With Nginx","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/03\/How-To-Configure-PHP-FPM-With-Nginx.png?fit=1200%2C667&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/03\/How-To-Configure-PHP-FPM-With-Nginx.png?fit=1200%2C667&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/03\/How-To-Configure-PHP-FPM-With-Nginx.png?fit=1200%2C667&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/03\/How-To-Configure-PHP-FPM-With-Nginx.png?fit=1200%2C667&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/03\/How-To-Configure-PHP-FPM-With-Nginx.png?fit=1200%2C667&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":5492,"url":"https:\/\/www.magetop.com\/blog\/cai-dat-magento-2-4-2-tren-ubuntu\/","url_meta":{"origin":9872,"position":5},"title":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t Magento 2.4.2 tr\u00ean Ubuntu","author":"Callula Huy","date":"May 19, 2021","format":false,"excerpt":"Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch c\u00e0i \u0111\u1eb7t Magento 2.4.2 tr\u00ean Ubuntu.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t Magento 2.4.2 tr\u00ean Ubuntu","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/Huong-dan-cai-dat-Magento-2.4.2-tren-Ubuntu.png?fit=750%2C422&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/Huong-dan-cai-dat-Magento-2.4.2-tren-Ubuntu.png?fit=750%2C422&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/Huong-dan-cai-dat-Magento-2.4.2-tren-Ubuntu.png?fit=750%2C422&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/05\/Huong-dan-cai-dat-Magento-2.4.2-tren-Ubuntu.png?fit=750%2C422&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/9872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/users\/106"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/comments?post=9872"}],"version-history":[{"count":6,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/9872\/revisions"}],"predecessor-version":[{"id":9880,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/9872\/revisions\/9880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media\/9879"}],"wp:attachment":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media?parent=9872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/categories?post=9872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/tags?post=9872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}