<?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>PHP 7.2 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/php-7-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 08 Oct 2018 19:02:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>How to install PHP 7.2 on Debian 9 Stretch?</title>
		<link>https://www.osradar.com/how-to-install-php-7-2-on-debian-9-stretch/</link>
					<comments>https://www.osradar.com/how-to-install-php-7-2-on-debian-9-stretch/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 09 Oct 2018 01:00:40 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 7.2]]></category>
		<category><![CDATA[Programming language]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Stretch]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[web development]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=6257</guid>

					<description><![CDATA[<p>Recently I explained how to install PHP 7 in CentOS 7. Today, I will show how to install PHP 7.2 on Debian 9. Linux server-oriented operating systems use not-so-current versions of the basic packages because they are the most tested. This situation has as main advantage that the packages that are in the official repositories [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-php-7-2-on-debian-9-stretch/">How to install PHP 7.2 on Debian 9 Stretch?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I <a href="https://www.osradar.com/how-to-install-php-7-on-centos-7-in-an-easy-way/">explained</a> how to install PHP 7 in CentOS 7. Today, I will show how to install PHP 7.2 on Debian 9.</p>
<p>Linux server-oriented operating systems use not-so-current versions of the basic packages because they are the most tested. This situation has as main advantage that the packages that are in the official repositories are very stable; however, not having the latest versions of the packages means that new features are not always available.</p>
<figure id="attachment_6287" aria-describedby="caption-attachment-6287" style="width: 1120px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6287" src="https://www.osradar.com/wp-content/uploads/2018/10/11-2.png" alt="Linux Security" width="1120" height="450" srcset="https://www.osradar.com/wp-content/uploads/2018/10/11-2.png 1120w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-300x121.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-768x309.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-1024x411.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-696x280.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-1068x429.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/11-2-1045x420.png 1045w" sizes="(max-width: 1120px) 100vw, 1120px" /><figcaption id="caption-attachment-6287" class="wp-caption-text">Linux Security</figcaption></figure>
<p>With this in mind, it&#8217;s easy to assume that some essential applications can&#8217;t be used without updating some key packages like PHP. For example, the latest stable version of <a href="https://laravel.com/docs/5.7#installing-laravel">Laravel</a> requires PHP 7.1.3 <strong>but Debian 9 brings in its repositories version 7.0.</strong></p>
<p>In others words, there are times when it is necessary to update some essential packages. Today it&#8217;s PHP&#8217;s turn on Debian 9.</p>
<h2>Why you need</h2>
<p>The process is quite simple, however, you must execute commands as a superuser. To do this, you can use a user with sudo enabled or directly be root.</p>
<p>You also need to be somewhat familiar with the use of the terminal, as we will do everything through the command line interface.</p>
<p>With this in mind, you can get started to install PHP 7.2.</p>
<h2>Let&#8217;s get to work</h2>
<p>Now that you have decided to update <a href="http://php.net/">PHP</a>, the first thing is to update the system. With that, you will get the versions of the packages but only those related to security. Anyway, it&#8217;s a good idea to do it. Run:</p>
<pre class="">:~$ su</pre>
<p>Then, enter your password to become root. Now, run:</p>
<pre class="">:~# apt update &amp;&amp; apt upgrade</pre>
<figure id="attachment_6276" aria-describedby="caption-attachment-6276" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6276" src="https://www.osradar.com/wp-content/uploads/2018/10/1-5.png" alt="1.- Upgrading the system" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/1-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/1-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6276" class="wp-caption-text">1.- Upgrading the system</figcaption></figure>
<p>That&#8217;s enough.</p>
<p>So, you can check this by executing the following command:</p>
<pre class="">:~# apt-cache show php</pre>
<figure id="attachment_6277" aria-describedby="caption-attachment-6277" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6277" src="https://www.osradar.com/wp-content/uploads/2018/10/2-5.png" alt="2.- Showing the version of the PHP package that comes in the official repositories." width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/2-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/2-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6277" class="wp-caption-text">2.- Showing the version of the PHP package that comes in the official repositories.</figcaption></figure>
<p>As you can see, Debian 9 comes with PHP 7.0 by default.</p>
<p>The next step is to install some necessary packages such as: <code>apt-transport-https</code> <code>lsb-release</code> and <code>ca-certificates</code>.</p>
<pre class="">:~# apt install apt-transport-https lsb-release ca-certificates</pre>
<figure id="attachment_6278" aria-describedby="caption-attachment-6278" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6278" src="https://www.osradar.com/wp-content/uploads/2018/10/3-5.png" alt="3.- Installing some required packages" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/3-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/3-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6278" class="wp-caption-text">3.- Installing some required packages</figcaption></figure>
<p>To install PHP 7.2 you need an external repository. Run:</p>
<pre class="">:~# wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg</pre>
<figure id="attachment_6281" aria-describedby="caption-attachment-6281" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-6281 size-full" src="https://www.osradar.com/wp-content/uploads/2018/10/4-1-1.png" alt="4.- Downloading GPG key" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/4-1-1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/4-1-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6281" class="wp-caption-text">4.- Downloading GPG key</figcaption></figure>
<p>Next:</p>
<pre class="">:~# sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" &gt; /etc/apt/sources.list.d/php.list'</pre>
<figure id="attachment_6282" aria-describedby="caption-attachment-6282" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-6282 size-full" src="https://www.osradar.com/wp-content/uploads/2018/10/5-1-1.png" alt="5.- Adding the external repository to install PHP 7.2" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/5-1-1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/5-1-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6282" class="wp-caption-text">5.- Adding the external repository to install PHP 7.2</figcaption></figure>
<p>Then, proceed to update the repository cache.</p>
<pre class="">:~# apt update</pre>
<figure id="attachment_6283" aria-describedby="caption-attachment-6283" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6283" src="https://www.osradar.com/wp-content/uploads/2018/10/6-1-1.png" alt="6.- apt update command" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/6-1-1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/6-1-1-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6283" class="wp-caption-text">6.- apt update command</figcaption></figure>
<p>Now, search the repository database for the PHP package and you&#8217;ll see that version 7.2 is available.</p>
<figure id="attachment_6284" aria-describedby="caption-attachment-6284" style="width: 1357px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6284" src="https://www.osradar.com/wp-content/uploads/2018/10/7-3.png" alt="7.- Showing the new version of PHP on repository" width="1357" height="386" srcset="https://www.osradar.com/wp-content/uploads/2018/10/7-3.png 1357w, https://www.osradar.com/wp-content/uploads/2018/10/7-3-300x85.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/7-3-768x218.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/7-3-1024x291.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/7-3-696x198.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/7-3-1068x304.png 1068w" sizes="(max-width: 1357px) 100vw, 1357px" /><figcaption id="caption-attachment-6284" class="wp-caption-text">7.- Showing the new version of PHP on the repository</figcaption></figure>
<p>And proceed to install the PHP 7.2 packages you want. I&#8217;ll install these for now.</p>
<pre class="">:~# apt install php7.2 php7.2-common php7.2-cli php7.2-mysql php7.2-xml php7.2-curl</pre>
<figure id="attachment_6285" aria-describedby="caption-attachment-6285" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6285" src="https://www.osradar.com/wp-content/uploads/2018/10/8-3.png" alt="8.- Installing PHP7.2 packages" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/8-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/8-3-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6285" class="wp-caption-text">8.- Installing PHP7.2 packages</figcaption></figure>
<p>Finally, you can check the installed version. To do this, run.</p>
<pre class="">:~# php -v</pre>
<figure id="attachment_6286" aria-describedby="caption-attachment-6286" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6286" src="https://www.osradar.com/wp-content/uploads/2018/10/9-3.png" alt="9.- Showing the PHP version installed." width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/9-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/9-3-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6286" class="wp-caption-text">9.- Showing the PHP version installed.</figcaption></figure>
<h2>Conclusion</h2>
<p>In the final analysis, it can be said that having old and tested packages has its advantages but from time to time it is convenient to update them. Especially if other applications make use of them like Laravel with PHP.</p>
<p>Installing PHP 7.2 in Debian 9 is simple and it is recommended to do it to have important security updates especially if the server works a lot with web applications.</p>
<p>We want to know about you, have you used PHP? is your favorite language? did you find the article interesting? let us know in the comments.</p>
<p>Please share this article.</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-php-7-2-on-debian-9-stretch/">How to install PHP 7.2 on Debian 9 Stretch?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-php-7-2-on-debian-9-stretch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
