How To Update PHP 7.0 to PHP 7.2 on Debian Easily

Linux, PHP

More than a year a go, I wrote about how to upgrade PHP 5.6 to PHP 7.0.

Now, PHP 7.0 will reached the end of its critical support through December 2018. After that date PHP community will no longer provides support for bugs. Following to PHP 7.0, PHP 7.1 will be put under discontinued support next year.

Also, since dotdeb dropped support for PHP 7.1 and later so we will use another package provided by Ondřej Surý’s.

Let’s get into the action.

Installing Ondřej’s Package

then, install php 7.2

installing php7.2-fpm will automatically install another dependencies, so don’t bother by installing them one by one.

Install php-mysql

Configuring Nginx Server Block

You can change the block in every domain configuration if you want to use multiple php install. To change a domain to use PHP 7.2 open the server block:



Start PHP 7.2 and Shutdown PHP 7.0

If you want to shutdown the PHP 7.0

Restart Nginx

Now your sites running under PHP 7.2.

Remove Old PHP 7.0 Packages (optional)

If you are ready to move on, let’s proceed on the removal:


Any idea? Fill the comment below

This site uses Akismet to reduce spam. Learn how your comment data is processed.