Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

[HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
13 posts
  • 1
  • 2
  • Next
xorro
Posts: 87
Joined: Sun Nov 13, 2016 3:11 pm
Contact:
Contact xorro
Website Skype

Os: CentOS 6x
Web: apache + nginx
[HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by xorro » Tue Sep 11, 2018 6:27 pm

In this tutorial I’ll show you how to upgrade PHP 5.6.xx which is by default installed by Vesta CP during installation to PHP 7.2.xx latest, I’ve tested on many server before writing this tutorial and its just working fine without any issue hence it is safe to upgrade to PHP 7.2, part of this tutorial is copied from remi repository.

Why upgrade to php 7.2 – Because it will give you security & performance boost + KICK, since WordPress will load much faster and uses less resources.

STEP 1 :

Install Remi Repository and EPEL Repository on your server :

RHEL 7

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms
RHEL 6

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6
CentOS 7

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
CentOS 6

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
STEP 2 :

After you have installed repository you need to follow some extra configurations :
Run this command one by one for RHEL or CentOS

Code: Select all

yum install yum-utils
yum-config-manager --enable remi-php72
STEP 3 :

Now just run this command :

Code: Select all

yum update -y
You’ll see php packages are getting updated, After the update process you need to restart Apache server/php-fpm-(nginx) and check the php version from by below mentioned command:

Code: Select all

php -v

Code: Select all

[root@server ~]# php -v
PHP 7.2.7 (cli) (built: Jun 20 2018 08:21:26) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies
Troubleshoot

If php upgrade process fails (no update/nothing happens) or you upgraded previously from 5.6 to 7.0/7.1 then you need to run this commands to disable php 5.6/7.0/7.1 :

Code: Select all

yum-config-manager --disable remi-php56
yum-config-manager --disable remi-php70
yum-config-manager --disable remi-php71
After that follow the tutorial from STEP 2 again.
Top

valentine
Posts: 16
Joined: Sat Sep 01, 2018 4:10 am

Os: Ubuntu 15x
Web: nginx + php-fpm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by valentine » Thu Sep 13, 2018 2:16 am

+ viewtopic.php?t=16905
Top

pipoy
Posts: 112
Joined: Mon Sep 11, 2017 8:02 am

Os: CentOS 6x
Web: apache
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by pipoy » Wed Sep 19, 2018 12:03 am

Wow thank you!
Top

pro100ssk
Posts: 114
Joined: Mon Oct 19, 2015 12:12 pm

Os: Debian 8x
Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by pro100ssk » Tue Nov 27, 2018 10:27 pm

.
Last edited by pro100ssk on Mon Feb 18, 2019 9:41 pm, edited 1 time in total.
Top

sandy
Posts: 90
Joined: Sat Apr 07, 2018 7:06 pm
Contact:
Contact sandy
Website

Os: CentOS 6x
Web: nginx + php-fpm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by sandy » Sat Dec 29, 2018 7:43 pm

source :
https://www.mysterydata.com/upgrade-php ... -vesta-cp/
Top

lex0013
Posts: 36
Joined: Tue Oct 28, 2014 9:26 am
Contact:
Contact lex0013
Website Facebook

Os: CentOS 6x
Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by lex0013 » Mon Apr 08, 2019 5:07 am

According to this manual there will be an update from 7.2 to 7.3
Top

zzmaster
Posts: 3
Joined: Fri Sep 20, 2019 7:06 pm
Contact:
Contact zzmaster
Website

Os: CentOS 5x
Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by zzmaster » Sat Oct 26, 2019 9:57 am

I'm stuck with (CentOS 6)

Code: Select all

[root@celebraza ~]# rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6
-bash: rhn-channel: command not found
It's strange that topic starter didn't face this since rhn-channel not in standard configuration. The only googled related page
https://support.nagios.com/forum/viewto ... =6&t=50150
has solutions that don't work for me.

Can anybody help?
Top

lokutus
Posts: 2
Joined: Wed Apr 11, 2018 8:52 am

Os: CentOS 5x
Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by lokutus » Mon Nov 04, 2019 3:33 pm

Hello,

i followed your desc and PHP is 7.4.0RC5 version now, but i have some issue in PHPmyadmin. How can i solve this Problem?
need i downgrade PHP or anything else?

Image

Image
Top

Nightmaster
Posts: 9
Joined: Wed May 10, 2017 5:02 pm

Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by Nightmaster » Fri Aug 14, 2020 2:54 pm

Hey guys!
I just followed steps like written above to update from 5.6 to 7.2 version.
After all i rebooted server, and when i do php -v i get this:

Code: Select all

PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib64/php/modules/mysql.so (/usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_connect), /usr/lib64/php/modules/mysql.so.so (/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP 7.2.33 (cli) (built: Aug  4 2020 09:54:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[root@server etc]#
I tried to find mcrypt and json in php.ini and remove those, but there are no such lines?
Also, when i upload phpinfo(); file on my server it's showing my php version is -> PHP Version 5.4.45, how is that possible? My WP installations stopped working, it's throwing errors:
Your server is running PHP version 5.4.45 but WordPress 5.4.1 requires at least 5.6.20.
Do you have any ideas what may be wrong?

Thanks! :)
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
  • Quote

Post by grayfolk » Fri Aug 14, 2020 4:22 pm

Nightmaster wrote: ↑
Fri Aug 14, 2020 2:54 pm
Hey guys!
I just followed steps like written above to update from 5.6 to 7.2 version.
After all i rebooted server, and when i do php -v i get this:

Code: Select all

PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib64/php/modules/mysql.so (/usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_connect), /usr/lib64/php/modules/mysql.so.so (/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP 7.2.33 (cli) (built: Aug  4 2020 09:54:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[root@server etc]#
I tried to find mcrypt and json in php.ini and remove those, but there are no such lines?
See /etc/php.d folder
Nightmaster wrote: ↑
Fri Aug 14, 2020 2:54 pm
Also, when i upload phpinfo(); file on my server it's showing my php version is -> PHP Version 5.4.45, how is that possible? My WP installations stopped working, it's throwing errors:
Your server is running PHP version 5.4.45 but WordPress 5.4.1 requires at least 5.6.20.
Dont forget to reboot apache or php-fpm after change php version.
Top


Post Reply
  • Print view

13 posts
  • 1
  • 2
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password