Installing PHP 7.x on Centos 7

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

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 Post
Installing Mariadb (MySQL) On Centos 7
Next Post
Configuring Virtual Host In Centos 7 VPS

Related Posts

1 Comment. Leave new

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.

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

Menu