How to update the PHP version after PMTA Installation

Some times, we require to update the PHP version without data loss.

As I installed PowerMTA on my server and setup everything. After everything, when I tried to use Mumara, it shows me ioncube Loader error.

After installing ioncube loader, I came to know that ioncube is installed for PHP 5.3

Mumara still not works at all.

First we have to check what version of PHP is already installed and for that we can use the command as:

php -v

 

Method 1 to Update PHP

Current Scenario

PHP 5.3.3 (cli) (built: Nov 1 2019 12:28:08)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Run the 1st Command

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Run 2nd Command

yum --enablerepo=remi-php56 upgrade php-mysql php-devel php-gd php-pecl-memcache php-xmlrpc php-pspell php-snmp

Now Check the Status with php -v command

php -v

Here is the output

PHP 5.6.40 (cli) (built: Mar 17 2020 07:51:44)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
back to menu ↑

Method 2 to Update PHP

Upgrade PHP from 5.3 to 5.6

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install yum-plugin-replace
yum replace php-common --replace-with=php56w-common
back to menu ↑

Method 3 to Update PHP

Do not use this method if you are running VestaCP. I tried it on VestaCP with CentOS 6_x64 and it does not work for me.

Install the Remi and EPEL repositories

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Enable the REMI repository globally:

Run the following commands and edit remi.repo file.

nano /etc/yum.repos.d/remi.repo

Under the section that looks like [remi] make the following changes:

[remi]
name=Remi’s RPM repository for Enterprise Linux 6 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Also, under the section that looks like [remi-php56] make the following changes:

[remi-php56]
name=Remi’s PHP 5.6 RPM repository for Enterprise Linux 6 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable “remi”
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Type CTRL-O to save and CTRL-X to close the editor

Upgrading

Now we can upgrade PHP. Simply type in the following command:

yum -y upgrade php*

You will see that the version is now 5.6

PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
We will be happy to hear your thoughts

Leave a reply

Register New Account
Reset Password