Force EE To Use PHP 7.2

Hi Guys,

I just installed EE on my Ubuntu VPS. As the installation flags I chose --php7 --letsencrypt and redis cache ( can’t remember the flag. Upon completion I found that EE installed Wordpress on PHP 7.0.~. Meanwhile the EE stack runs on PHP 5~

I successfully installed PHP 7.2 onto my system Wordpress was still running on PHP 7.0. I verified this by creating the php info file and running the “ee stack info” cmd line.

But when I ran php -v This is what I got PHP 7.2.0RC1 (cli) (built: Sep 4 2017 08:42:27) ( NTS ) Copyright © 1997-2017 The PHP Group Zend Engine v3.2.0-dev, Copyright © 1998-2017 Zend Technologies with Zend OPcache v7.2.0RC1, Copyright © 1999-2017, by Zend Technologies

I knew something was wrong here. Since this is the first VPS I am working with, I really don’t know much about it. Upon running the following command I got the output below. I want to use PHP 7.2 on Wordpress and I am aware of the incompatibilities. Any help?

dpkg -l | grep php

ii  libapache2-mod-php7.1              7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.2              7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                         1:55+ubuntu16.04.1+deb.sury.org+1                        all          Common files for PHP packages
ii  php-igbinary                       2.0.1-1+ubuntu16.04.1+deb.sury.org+2                     amd64        igbinary PHP serializer
ii  php-imagick                        3.4.3-2~ubuntu16.04.1+deb.sury.org+1                     amd64        Provides a wrapper to the ImageMagick library
ii  php-memcache                       3.0.9~20160311.4991c2f-6+ubuntu16.04.1+deb.sury.org+2    amd64        memcache extension module for PHP
ii  php-memcached                      3.0.3+2.2.0-1+ubuntu16.04.1+deb.sury.org+3               amd64        memcached extension module for PHP, uses libmemcached
ii  php-msgpack                        2.0.2+0.5.7-1+ubuntu16.04.1+deb.sury.org+3               amd64        PHP extension for interfacing with MessagePack
ii  php-pear                           1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 all          PEAR Base System
ii  php-redis                          3.1.4~rc1.really.3.1.2-1+ubuntu16.04.1+deb.sury.org+1    amd64        PHP extension for interfacing with Redis
ii  php-xdebug                         2.5.5-3+ubuntu16.04.1+deb.sury.org+1                     amd64        Xdebug Module for PHP
ii  php5.6-bcmath                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Bcmath module for PHP
ii  php5.6-cli                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        documentation, examples and common module for PHP
ii  php5.6-curl                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        CURL module for PHP
ii  php5.6-fpm                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-gd                          5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        GD module for PHP
ii  php5.6-imap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        IMAP module for PHP
ii  php5.6-json                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        JSON module for PHP
ii  php5.6-mbstring                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        libmcrypt module for PHP
ii  php5.6-mysql                       5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MySQL module for PHP
ii  php5.6-opcache                     5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zend OpCache module for PHP
ii  php5.6-readline                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        readline module for PHP
ii  php5.6-recode                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        recode module for PHP
ii  php5.6-soap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        SOAP module for PHP
ii  php5.6-xml                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php5.6-zip                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zip module for PHP
ii  php7.0-bcmath                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Bcmath module for PHP
ii  php7.0-cli                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        documentation, examples and common module for PHP
ii  php7.0-curl                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        CURL module for PHP
ii  php7.0-fpm                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.0-gd                          7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        GD module for PHP
ii  php7.0-imap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        IMAP module for PHP
ii  php7.0-json                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        JSON module for PHP
ii  php7.0-mbstring                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MBSTRING module for PHP
ii  php7.0-mcrypt                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        libmcrypt module for PHP
ii  php7.0-mysql                       7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
ii  php7.0-opcache                     7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zend OpCache module for PHP
ii  php7.0-readline                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        readline module for PHP
ii  php7.0-recode                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        recode module for PHP
ii  php7.0-soap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        SOAP module for PHP
ii  php7.0-xml                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.0-zip                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zip module for PHP
ii  php7.1                             7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.1-cli                         7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        command-line interpreter for the PHP scripting language
ii  php7.1-common                      7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        documentation, examples and common module for PHP
ii  php7.1-json                        7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        JSON module for PHP
ii  php7.1-opcache                     7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        Zend OpCache module for PHP
ii  php7.1-readline                    7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        readline module for PHP
ii  php7.2                             7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.2-cli                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                      7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        documentation, examples and common module for PHP
ii  php7.2-fpm                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-json                        7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        JSON module for PHP
ii  php7.2-mysql                       7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        MySQL module for PHP
ii  php7.2-opcache                     7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        Zend OpCache module for PHP
ii  php7.2-readline                    7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        readline module for PHP
root@geeksultddotcom:~# ee stack remove php
usage: ee stack (command) [options]
ee: error: unrecognized arguments: php
root@geeksultddotcom:~# ee stack remove php5
usage: ee stack (command) [options]
ee: error: unrecognized arguments: php5
root@geeksultddotcom:~# dpkg -l | grep php
ii  libapache2-mod-php7.1              7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.2              7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                         1:55+ubuntu16.04.1+deb.sury.org+1                        all          Common files for PHP packages
ii  php-igbinary                       2.0.1-1+ubuntu16.04.1+deb.sury.org+2                     amd64        igbinary PHP serializer
ii  php-imagick                        3.4.3-2~ubuntu16.04.1+deb.sury.org+1                     amd64        Provides a wrapper to the ImageMagick library
ii  php-memcache                       3.0.9~20160311.4991c2f-6+ubuntu16.04.1+deb.sury.org+2    amd64        memcache extension module for PHP
ii  php-memcached                      3.0.3+2.2.0-1+ubuntu16.04.1+deb.sury.org+3               amd64        memcached extension module for PHP, uses libmemcached
ii  php-msgpack                        2.0.2+0.5.7-1+ubuntu16.04.1+deb.sury.org+3               amd64        PHP extension for interfacing with MessagePack
ii  php-pear                           1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 all          PEAR Base System
ii  php-redis                          3.1.4~rc1.really.3.1.2-1+ubuntu16.04.1+deb.sury.org+1    amd64        PHP extension for interfacing with Redis
ii  php-xdebug                         2.5.5-3+ubuntu16.04.1+deb.sury.org+1                     amd64        Xdebug Module for PHP
ii  php5.6-bcmath                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Bcmath module for PHP
ii  php5.6-cli                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        documentation, examples and common module for PHP
ii  php5.6-curl                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        CURL module for PHP
ii  php5.6-fpm                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-gd                          5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        GD module for PHP
ii  php5.6-imap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        IMAP module for PHP
ii  php5.6-json                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        JSON module for PHP
ii  php5.6-mbstring                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        libmcrypt module for PHP
ii  php5.6-mysql                       5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MySQL module for PHP
ii  php5.6-opcache                     5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zend OpCache module for PHP
ii  php5.6-readline                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        readline module for PHP
ii  php5.6-recode                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        recode module for PHP
ii  php5.6-soap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        SOAP module for PHP
ii  php5.6-xml                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php5.6-zip                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zip module for PHP
ii  php7.0-bcmath                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Bcmath module for PHP
ii  php7.0-cli                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        documentation, examples and common module for PHP
ii  php7.0-curl                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        CURL module for PHP
ii  php7.0-fpm                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.0-gd                          7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        GD module for PHP
ii  php7.0-imap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        IMAP module for PHP
ii  php7.0-json                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        JSON module for PHP
ii  php7.0-mbstring                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MBSTRING module for PHP
ii  php7.0-mcrypt                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        libmcrypt module for PHP
ii  php7.0-mysql                       7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
ii  php7.0-opcache                     7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zend OpCache module for PHP
ii  php7.0-readline                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        readline module for PHP
ii  php7.0-recode                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        recode module for PHP
ii  php7.0-soap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        SOAP module for PHP
ii  php7.0-xml                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.0-zip                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zip module for PHP
ii  php7.1                             7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.1-cli                         7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        command-line interpreter for the PHP scripting language
ii  php7.1-common                      7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        documentation, examples and common module for PHP
ii  php7.1-json                        7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        JSON module for PHP
ii  php7.1-opcache                     7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        Zend OpCache module for PHP
ii  php7.1-readline                    7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        readline module for PHP
ii  php7.2                             7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.2-cli                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                      7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        documentation, examples and common module for PHP
ii  php7.2-fpm                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-json                        7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        JSON module for PHP
ii  php7.2-mysql                       7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        MySQL module for PHP
ii  php7.2-opcache                     7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        Zend OpCache module for PHP
ii  php7.2-readline                    7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        readline module for PHP
root@geeksultddotcom:~#
root@geeksultddotcom:~# sudo service php5.6-fpm stop
root@geeksultddotcom:~# sudo service php7.0-fpm stop
root@geeksultddotcom:~# sudo service php7.0-fpm start
root@geeksultddotcom:~# dpkg -l | grep php
ii  libapache2-mod-php7.1              7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.2              7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                         1:55+ubuntu16.04.1+deb.sury.org+1                        all          Common files for PHP packages
ii  php-igbinary                       2.0.1-1+ubuntu16.04.1+deb.sury.org+2                     amd64        igbinary PHP serializer
ii  php-imagick                        3.4.3-2~ubuntu16.04.1+deb.sury.org+1                     amd64        Provides a wrapper to the ImageMagick library
ii  php-memcache                       3.0.9~20160311.4991c2f-6+ubuntu16.04.1+deb.sury.org+2    amd64        memcache extension module for PHP
ii  php-memcached                      3.0.3+2.2.0-1+ubuntu16.04.1+deb.sury.org+3               amd64        memcached extension module for PHP, uses libmemcached
ii  php-msgpack                        2.0.2+0.5.7-1+ubuntu16.04.1+deb.sury.org+3               amd64        PHP extension for interfacing with MessagePack
ii  php-pear                           1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 all          PEAR Base System
ii  php-redis                          3.1.4~rc1.really.3.1.2-1+ubuntu16.04.1+deb.sury.org+1    amd64        PHP extension for interfacing with Redis
ii  php-xdebug                         2.5.5-3+ubuntu16.04.1+deb.sury.org+1                     amd64        Xdebug Module for PHP
ii  php5.6-bcmath                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Bcmath module for PHP
ii  php5.6-cli                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        documentation, examples and common module for PHP
ii  php5.6-curl                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        CURL module for PHP
ii  php5.6-fpm                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-gd                          5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        GD module for PHP
ii  php5.6-imap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        IMAP module for PHP
ii  php5.6-json                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        JSON module for PHP
ii  php5.6-mbstring                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        libmcrypt module for PHP
ii  php5.6-mysql                       5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        MySQL module for PHP
ii  php5.6-opcache                     5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zend OpCache module for PHP
ii  php5.6-readline                    5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        readline module for PHP
ii  php5.6-recode                      5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        recode module for PHP
ii  php5.6-soap                        5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        SOAP module for PHP
ii  php5.6-xml                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php5.6-zip                         5.6.31-4+ubuntu16.04.1+deb.sury.org+4                    amd64        Zip module for PHP
ii  php7.0-bcmath                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Bcmath module for PHP
ii  php7.0-cli                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        documentation, examples and common module for PHP
ii  php7.0-curl                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        CURL module for PHP
ii  php7.0-fpm                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.0-gd                          7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        GD module for PHP
ii  php7.0-imap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        IMAP module for PHP
ii  php7.0-json                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        JSON module for PHP
ii  php7.0-mbstring                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MBSTRING module for PHP
ii  php7.0-mcrypt                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        libmcrypt module for PHP
ii  php7.0-mysql                       7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
ii  php7.0-opcache                     7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zend OpCache module for PHP
ii  php7.0-readline                    7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        readline module for PHP
ii  php7.0-recode                      7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        recode module for PHP
ii  php7.0-soap                        7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        SOAP module for PHP
ii  php7.0-xml                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.0-zip                         7.0.23-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zip module for PHP
ii  php7.1                             7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.1-cli                         7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        command-line interpreter for the PHP scripting language
ii  php7.1-common                      7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        documentation, examples and common module for PHP
ii  php7.1-json                        7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        JSON module for PHP
ii  php7.1-opcache                     7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        Zend OpCache module for PHP
ii  php7.1-readline                    7.1.9-1+ubuntu16.04.1+deb.sury.org+1                     amd64        readline module for PHP
ii  php7.2                             7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.2-cli                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                      7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        documentation, examples and common module for PHP
ii  php7.2-fpm                         7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-json                        7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        JSON module for PHP
ii  php7.2-mysql                       7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        MySQL module for PHP
ii  php7.2-opcache                     7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        Zend OpCache module for PHP
ii  php7.2-readline                    7.2.0~rc1-1+ubuntu16.04.1+deb.sury.org+2                 amd64        readline module for PHP

Hi Usman,

To understand what is happening and why your current WordPress keeps using php7.0-fpm, you may want to take a look in these config files. Let’s follow the trail starting with the main site config:

1. /etc/nginx/sites-available/example.com

You’ll notice a bunch of includes at the end, pointing at config files among which there are some with php7 in their name. If you used the --wpredis flag, the first one will be redis-php7.conf, so let’s move over to hat one.

2. /etc/nginx/common/redis-php7.conf

Notice the php7 in the last location block:

location ~ \.php$ {
  ...
  fastcgi_pass php7;
}

3. /etc/nginx/conf.d/upstream.conf

In this file, notice the last upstream block:

upstream php7 {
server 127.0.0.1:9070;
}

4. /etc/php/7.0/fpm/pool.d/www.conf

Notice the listen directive that matches the server directive: listen = 127.0.0.1:9070

Hope that makes it a bit clearer on how this all fits together. Your server may be running many php-fpm (or other) processes at the same time (in fact, it should be running both 5.6 and 7.0 by default with easy engine) one site will still use only one of them. It can use a second as fallback (common in the early days of php7 and hhvm where 5.6 was used to catch failing processes) but even so, your site is bound to specific versions by the nginx config.

So to make it all switch to php 7.2, first make sure php7.2-fpm is installed and then open /etc/php/7.0/fpm/pool.d/www.conf to find out on what server/port or socket that process is listening. Let’s say it’s something like listen = /run/php7.2-fpm.sock

Now the easiest will be to modify the upstream php7 block in upstream.conf but be aware this can be overwritten on future easyengine updates. Also, if you’re running more than one site, this will make all sites using the php7 upstream block to switch to PHP7.2 !!

upstream php7 {
  server unix:/run/php7.2-fpm.sock;
}

Save and reload Nginx

nginx -t && service nginx reload
2 Likes