<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SSH &#8211; MeghRaj TechnoSoft &#8211; Web, App, E-commerce Development  Agency In India.</title>
	<atom:link href="https://www.meghrajtechnosoft.com/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.meghrajtechnosoft.com</link>
	<description></description>
	<lastBuildDate>Mon, 07 Dec 2020 10:12:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.15</generator>

<image>
	<url>https://www.meghrajtechnosoft.com/wp-content/uploads/2020/10/fevecon.png</url>
	<title>SSH &#8211; MeghRaj TechnoSoft &#8211; Web, App, E-commerce Development  Agency In India.</title>
	<link>https://www.meghrajtechnosoft.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Install Different PHP (5.6, 7.0 and 7.1) Versions in Ubuntu</title>
		<link>https://www.meghrajtechnosoft.com/how-to-install-different-php-5-6-7-0-and-7-1-versions-in-ubuntu/</link>
					<comments>https://www.meghrajtechnosoft.com/how-to-install-different-php-5-6-7-0-and-7-1-versions-in-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 07 Dec 2020 08:06:07 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://www.meghrajtechnosoft.com/?p=17473</guid>

					<description><![CDATA[<p>PHP&#160;(recursive acronym for&#160;PHP: Hypertext Preprocessor) is an open source, popular general-purpose scripting language that is widely-used and best suited for developing websites and web-based applications. It is a server-side scripting language that can be embedded in HTML. Currently, there are [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.meghrajtechnosoft.com/how-to-install-different-php-5-6-7-0-and-7-1-versions-in-ubuntu/">How to Install Different PHP (5.6, 7.0 and 7.1) Versions in Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.meghrajtechnosoft.com">MeghRaj TechnoSoft - Web, App, E-commerce Development  Agency In India.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>PHP</strong>&nbsp;(recursive acronym for&nbsp;<strong>PHP: Hypertext Preprocessor</strong>) is an open source, popular general-purpose scripting language that is widely-used and best suited for developing websites and web-based applications. It is a server-side scripting language that can be embedded in HTML.</p>



<p>Currently, there are three supported versions of&nbsp;<strong>PHP</strong>, i.e&nbsp;<strong>PHP 5.6</strong>,&nbsp;<strong>7.0</strong>&nbsp;and&nbsp;<strong>7.1</strong>. Meaning&nbsp;<strong>PHP 5.3</strong>,&nbsp;<strong>5.4</strong>&nbsp;and&nbsp;<strong>5.5</strong>&nbsp;have all reached end of life; they are no longer supported with security updates.</p>



<p>In this article, we will explain how to install all the supported versions of&nbsp;<strong>PHP</strong>&nbsp;in&nbsp;<strong>Ubuntu</strong>&nbsp;and its derivatives with most requested PHP extensions for both&nbsp;<strong>Apache</strong>&nbsp;and&nbsp;<strong>Nginx</strong>&nbsp;web servers using a&nbsp;<strong>Ondřej Surý PPA</strong>. We will also explain how to set default version of PHP to be used on the Ubuntu system.</p>



<p>Note that&nbsp;<strong>PHP 7.x</strong>&nbsp;is the supported stable version in the Ubuntu software repositories, you can confirm this by running the&nbsp;apt command&nbsp;below.</p>



<pre><code>$sudo apt show php
OR
$ sudo apt show php -a</code></pre>



<pre><code>Package: php
Version: 1:7.0+35ubuntu6
Priority: optional
Section: php
Source: php-defaults (35ubuntu6)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 11.3 kB
Depends: php7.0
Supported: 5y
Download-Size: 2,832 B
APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
Description: server-side, HTML-embedded scripting language (default)
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.
 .
 This package is a dependency package, which depends on Debian's default
 PHP version (currently 7.0).</code></pre>



<p>To install the default PHP version from the Ubuntu software repositories, use the command below.</p>



<pre><code>$ sudo apt install php</code><pre>



<h3 id="h-install-php-5-6-7-0-7-1-on-ubuntu-using-ppa"><strong>Install PHP (5.6, 7.0, 7.1) on Ubuntu Using PPA</strong></h3>



<p><strong>1.</strong>&nbsp;First start by adding&nbsp;<strong>Ondřej Surý PPA</strong>&nbsp;to install different versions of PHP –&nbsp;<strong>PHP 5.6</strong>,&nbsp;<strong>PHP 7.0</strong>&nbsp;and&nbsp;<strong>PHP 7.1</strong>&nbsp;on Ubuntu system.</p>



<pre><code>$ sudo apt install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="885" height="706" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Add-PPA-in-Ubuntu-1.png" alt="" class="wp-image-17484" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Add-PPA-in-Ubuntu-1.png 885w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Add-PPA-in-Ubuntu-1-300x239.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Add-PPA-in-Ubuntu-1-768x613.png 768w" sizes="(max-width: 885px) 100vw, 885px" /></figure>



<p><strong>2.</strong>&nbsp;Next, update the system as follows.</p>



<pre><code>$ sudo apt-get update</code></pre>



<p><strong>3.</strong>&nbsp;Now install different supported versions of PHP as follows.</p>



<h3 id="h-for-apache-web-server">For Apache Web Server</h3>



<pre><code>$ sudo apt install php5.6   [PHP 5.6]
$ sudo apt install php7.0   [PHP 7.0]
$ sudo apt install php7.1   [PHP 7.1]
$ sudo apt install php7.2   [PHP 7.2]
$ sudo apt install php7.3   [PHP 7.3]</code></pre>



<h3 id="h-for-nginx-web-server">For Nginx Web Server</h3>



<pre><code>$ sudo apt install php5.6-fpm   [PHP 5.6]
$ sudo apt install php7.0-fpm   [PHP 7.0]
$ sudo apt install php7.1-fpm   [PHP 7.1]
$ sudo apt install php7.2-fpm   [PHP 7.2]
$ sudo apt install php7.3-fpm   [PHP 7.3]</code></pre>



<p><strong>4.</strong>&nbsp;To install any PHP modules, simply specify the PHP version and use the auto-completion functionality to view all modules as follows.</p>



<pre><code>------------ press Tab key for auto-completion ------------ 
$ sudo apt install php5.6 
$ sudo apt install php7.0 
$ sudo apt install php7.1
$ sudo apt install php7.2
$ sudo apt install php7.3 </code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="762" height="266" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Search-PHP-Modules.png" alt="" class="wp-image-17476" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Search-PHP-Modules.png 762w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Search-PHP-Modules-300x105.png 300w" sizes="(max-width: 762px) 100vw, 762px" /></figure>



<p><strong>5.</strong>&nbsp;Now you can install most required PHP modules from the list..</p>



<pre><code>------------ Install PHP Modules ------------
$ sudo apt install php5.6-cli php5.6-xml php5.6-mysql 
$ sudo apt install php7.0-cli php7.0-xml php7.0-mysql 
$ sudo apt install php7.1-cli php7.1-xml php7.1-mysql
$ sudo apt install php7.2-cli php7.2-xml php7.2-mysql 
$ sudo apt install php7.3-cli php7.3-xml php7.3-mysql  </code><pre>



<p><strong>6.</strong>&nbsp;Finally, verify your default PHP version used on your system like this.</p>



<pre><code>$ php -v </code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="803" height="266" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png" alt="" class="wp-image-17477" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png 803w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-300x99.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-768x254.png 768w" sizes="(max-width: 803px) 100vw, 803px" /></figure>



<h3 id="h-set-default-php-version-in-ubuntu">Set Default PHP Version in Ubuntu</h3>



<p><strong>7.</strong>&nbsp;You can set the default PHP version to be used on the system with the&nbsp;<strong>update-alternatives</strong>&nbsp;command, after setting it, check the PHP version to confirm as follows.</p>



<pre><code>------------ Set Default PHP Version 5.6 ------------
$ sudo update-alternatives --set php /usr/bin/php5.6</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="803" height="266" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png" alt="" class="wp-image-17477" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png 803w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-300x99.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-768x254.png 768w" sizes="(max-width: 803px) 100vw, 803px" /></figure>



<pre><code>------------ Set Default PHP Version 7.0 ------------
$ sudo update-alternatives --set php /usr/bin/php7.0</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="803" height="266" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png" alt="" class="wp-image-17477" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu.png 803w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-300x99.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Set-PHP-5.6-in-Ubuntu-768x254.png 768w" sizes="(max-width: 803px) 100vw, 803px" /></figure>



<pre><code>------------ Set Default PHP Version 7.1 ------------
$ sudo update-alternatives --set php /usr/bin/php7.1</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="804" height="244" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/pppSet-PHP-7.0-in-Ubuntu.png" alt="" class="wp-image-17475" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/pppSet-PHP-7.0-in-Ubuntu.png 804w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/pppSet-PHP-7.0-in-Ubuntu-300x91.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/pppSet-PHP-7.0-in-Ubuntu-768x233.png 768w" sizes="(max-width: 804px) 100vw, 804px" /></figure>



<p><strong>8.</strong>&nbsp;To set the PHP version that will work with&nbsp;<strong>Apache</strong>&nbsp;web server, use the commands below. First disable the current version with the&nbsp;<strong>a2dismod</strong>&nbsp;command and then enable the one you want with the&nbsp;<strong>a2enmod</strong>&nbsp;command.</p>



<pre><code>$ sudo a2dismod php7.0
$ sudo a2enmod php7.1
$ sudo systemctl restart apache2</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="623" height="323" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Enable-Disable-PHP-Modules-for-Apache.png" alt="" class="wp-image-17482" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Enable-Disable-PHP-Modules-for-Apache.png 623w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/Enable-Disable-PHP-Modules-for-Apache-300x156.png 300w" sizes="(max-width: 623px) 100vw, 623px" /></figure>



<p><strong>9.</strong>&nbsp;After switching from one version to another, you can find your PHP configuration file, by running the command below.</p>



<pre><code>------------ For PHP 5.6 ------------
$ sudo update-alternatives --set php /usr/bin/php5.6
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7.0 ------------
$ sudo update-alternatives --set php /usr/bin/php7.0
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7.1 ------------
$ sudo update-alternatives --set php /usr/bin/php7.1
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7.2 ------------
$ sudo update-alternatives --set php /usr/bin/php7.2
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7.3 ------------
$ sudo update-alternatives --set php /usr/bin/php7.3
$ php -i | grep "Loaded Configuration File"</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="804" height="420" src="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/aaFind-PHP-Configuration-File.png" alt="" class="wp-image-17478" srcset="https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/aaFind-PHP-Configuration-File.png 804w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/aaFind-PHP-Configuration-File-300x157.png 300w, https://www.meghrajtechnosoft.com/wp-content/uploads/2020/12/aaFind-PHP-Configuration-File-768x401.png 768w" sizes="(max-width: 804px) 100vw, 804px" /></figure>



<p>In this article, we showed how to install all the supported versions of PHP in Ubuntu and its derivatives. If you have any queries or thoughts to share, do so via the feedback form below.</p>
<p>The post <a rel="nofollow" href="https://www.meghrajtechnosoft.com/how-to-install-different-php-5-6-7-0-and-7-1-versions-in-ubuntu/">How to Install Different PHP (5.6, 7.0 and 7.1) Versions in Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.meghrajtechnosoft.com">MeghRaj TechnoSoft - Web, App, E-commerce Development  Agency In India.</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.meghrajtechnosoft.com/how-to-install-different-php-5-6-7-0-and-7-1-versions-in-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Switch between Multiple PHP Version on Ubuntu</title>
		<link>https://www.meghrajtechnosoft.com/how-to-switch-between-multiple-php-version-on-ubuntu/</link>
					<comments>https://www.meghrajtechnosoft.com/how-to-switch-between-multiple-php-version-on-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 07 Dec 2020 07:56:06 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">https://www.meghrajtechnosoft.com/?p=17460</guid>

					<description><![CDATA[<p>On your system, if you have&#160;installed multiple versions&#160;of PHP (eg PHP 7.4 and PHP 5.6 both). PHP 7.4 is running as default PHP for Apache and CLI. For any requirement, you need to use PHP 5.6. Then you don’t need [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.meghrajtechnosoft.com/how-to-switch-between-multiple-php-version-on-ubuntu/">How to Switch between Multiple PHP Version on Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.meghrajtechnosoft.com">MeghRaj TechnoSoft - Web, App, E-commerce Development  Agency In India.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>On your system, if you have&nbsp;installed multiple versions&nbsp;of PHP (eg PHP 7.4 and PHP 5.6 both). PHP 7.4 is running as default PHP for Apache and CLI. For any requirement, you need to use PHP 5.6. Then you don’t need to remove PHP 7.4. You can simply switch your PHP version to default used for Apache and command line.</p>



<p>For example, your server has PHP 7.4 and PHP 5.6 both version’s installed. Now following example will help you to switch between both versions. The PHP 5.6 is configured as default PHP version for Apache and CLI. Let’s make PHP 7.4 as default PHP for Apache server and CLI.</p>



<h4 id="h-switch-from-php-5-6-php-7-4">Switch From PHP 5.6 =&gt; PHP 7.4</h4>



<p>The PHP 5.6 is set as default version in your system, and you need to switch to PHP 7.4. Run the following commands to switch for Apache and command line.</p>



<p><strong>Apache:-</strong></p>



<pre><code>sudo a2dismod php5.6
sudo a2enmod php7.4
sudo service apache2 restart</code></pre>



<p><strong>Command Line:-</strong></p>



<pre><code>sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4</code></pre>



<h4 id="h-switch-from-php-7-4-php-5-6">Switch From PHP 7.4 =&gt; PHP 5.6</h4>



<p>Default PHP 7.4 is set on your system and you need to switch to PHP 5.6. Now run the following commands to switch for Apache and command line.</p>



<p><strong>Apache:-</strong></p>



<pre><code>sudo a2dismod php7.4
sudo a2enmod php5.6
sudo service apache2 restart</code></pre>



<p><strong>Command Line:-</strong></p>



<pre><code>sudo update-alternatives --set php /usr/bin/php5.6
sudo update-alternatives --set phar /usr/bin/phar5.6
sudo update-alternatives --set phar.phar /usr/bin/phar.phar5.6 
sudo update-alternatives --set phpize /usr/bin/phpize5.6
sudo update-alternatives --set php-config /usr/bin/php-config5.6</code></pre>



<p>Conclusion: This tutorial helps you to switch between multiple PHP versions on Ubuntu system. This helps you to change default PHP version on your Apache server and command line interface.</p>
<p>The post <a rel="nofollow" href="https://www.meghrajtechnosoft.com/how-to-switch-between-multiple-php-version-on-ubuntu/">How to Switch between Multiple PHP Version on Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.meghrajtechnosoft.com">MeghRaj TechnoSoft - Web, App, E-commerce Development  Agency In India.</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.meghrajtechnosoft.com/how-to-switch-between-multiple-php-version-on-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
