By default the latest PHP version CentOS 7 supports is something along the lines of 5.6.14. However there is already a 7.2 version out at this time. If you just downloaded WordPress, after its installation you'll notice it wants a newer version than the 5.6.14.
For this I used this website:
Before starting the whole upgrading thing, make sure you're root:
sudo -i
Getting the necessary repositories and telling the system about them:
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
Activating PHP 7.2
yum install yum-utils
yum-config-manager --enable remi-php72
Aand upgrade!
yum update
Done
You can check the version like this :
php -v
For me that didn't work one time, so I just repeated the whole process again and all of a sudden it worked ¯\_(ツ)_/¯
One Reply to “Upgrade PHP on CentOS 7 to v7.2”