Ubuntu – How to upgrade PHP from 7.2 to 7.3 using the yum command on CentOS

centosphp-7.3Ubuntuyum

I am running an EC2 server on AWS and I was looking into upgrading php from 7.2 to 7.3. However, all the tutorials I found were on Ubuntu and they all used the apt command instead of yum.

I also ran the command cat /etc/os-release to find out what the operating system of my server is and the ID_LIKE line said ID_LIKE="centos rhel fedora".

I found instructions on the upgrade that are relatively simple on Ubuntu.
Does anyone know how I would translate the following commands for CentOS using yum instead of apt on Ubuntu?

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y php7.3

Best Answer

In CentOS you have to enable the extra epel repository first and change the php version.

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm 
sudo yum -y install epel-release yum-utils

sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php73

Then you should be able to install the new php version. Try yum update or reinstall the packages.

https://computingforgeeks.com/how-to-install-php-7-3-on-centos-7-fedora/

Related Topic