A journal for curious minds & hands-on builders.

Follow Marxtudor

Installing PHP 7.x on Centos 7

To install php 7.x we need to install a few things first

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

Now enable the version of php 7 you wish you install
sudo yum-config-manager –enable remi-php72

Note: if you want to install php 7.0 or 7.1 you can use the command below.
yum-config-manager –enable remi-php70
yum-config-manager –enable remi-php71
You see 72 stands for 7.2, 70 stands for version 7.0 and 71 stands for 7.1

Finally its time to installinstall PHP 7.2
sudo yum -y install php

Add (MySQL/MariaDB) database support to php
sudo yum -y install php-mysqlnd

Don’t forget to restart the server after php installation for the changes to take effect.
sudo service httpd restart
or
sudo systemctl restart httpd.service

Congrats you have now successfully install PHP 7.x in your server.

To check php version
php -v

Previous story
Next story

Join the conversation.

One response to “Installing PHP 7.x on Centos 7”

  1. Marcos

    thanks for tutorial!

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

    I get following error:

    /var/tmp/yum-root-KuesGj/remi-release-7.rpm: does not update installed package.
    Error: Nothing to do

    do you know why?

    thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.