Upgrading PHP 7.0 to PHP 7.2 on Centos 7

To upgrade PHP 7.0 to PHP 7.2 on Centos 7, the REMI repository and the yum-utils repository utility must be installed on our operating system

[[email protected]]# rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[[email protected]]# yum install yum-utils

See what PHP modules we have installed

[[email protected]]# yum list installed php*
Загружены модули: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.reconn.ru
 * epel: mirror.logol.ru
 * extras: mirror.reconn.ru
 * remi-php71: mirror.reconn.ru
 * remi-safe: mirror.reconn.ru
 * updates: mirror.reconn.ru
Установленные пакеты
php.x86_64                               7.1.10-1.el7.remi                          @remi-php71
php-cli.x86_64                           7.1.10-1.el7.remi                          @remi-php71
php-common.x86_64                        7.1.10-1.el7.remi                          @remi-php71
php-gd.x86_64                            7.1.10-1.el7.remi                          @remi-php71
php-json.x86_64                          7.1.10-1.el7.remi                          @remi-php71
php-ldap.x86_64                          7.1.10-1.el7.remi                          @remi-php71
php-mbstring.x86_64                      7.1.10-1.el7.remi                          @remi-php71
php-mysqlnd.x86_64                       7.1.10-1.el7.remi                          @remi-php71
php-odbc.x86_64                          7.1.10-1.el7.remi                          @remi-php71
php-opcache.x86_64                       7.1.10-1.el7.remi                          @remi-php71
php-pdo.x86_64                           7.1.10-1.el7.remi                          @remi-php71
php-pear.noarch                          1:1.10.5-2.el7.remi                        @remi-php71
php-pecl-zip.x86_64                      1.15.4-1.el7.remi.7.1                      @remi-php71
php-process.x86_64                       7.1.10-1.el7.remi                          @remi-php71
php-soap.x86_64                          7.1.10-1.el7.remi                          @remi-php71
php-xml.x86_64                           7.1.10-1.el7.remi                          @remi-php71
php-xmlrpc.x86_64                        7.1.10-1.el7.remi                          @remi-php71

Delete them and switch the REMI repository to work with PHP version 7.2

[[email protected]]# yum remove php*
[[email protected]]# yum-config-manager --disable remi-php71
[[email protected]]# yum-config-manager --enable remi-php72

Install PHP 7.2 and the modules we had and restart Apache

[[email protected]]# yum install php php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt php-common php-fpm php-pdo php-mysqlnd php-imap php-embedded php-ldap php-odbc php-zip php-fileinfo php-process php-opcache
[[email protected]]# systemctl restart httpd

UPD 02/07/2019 update to PHP 7.3

To upgrade to PHP 7.3, remove PHP 7.2, disable PHP 7.2 via yum-config-manager and enable PHP 7.3

[[email protected]]# yum remove php*
[[email protected]]# yum-config-manager --disable remi-php72
[[email protected]]# yum-config-manager --enable remi-php73

Install PHP 7.3 and the modules we had and restart Apache

[[email protected]]# yum install php php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt php-common php-fpm php-pdo php-mysqlnd php-imap php-embedded php-ldap php-odbc php-zip php-fileinfo php-process php-opcache
[[email protected]]# systemctl restart httpd
Sidebar