Linux

Install or Upgrade PHP to PHP7 on CentOS 7 Linux server

How to Install/Upgrade PHP on CentOS 7 Linux

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. For more information on PHP

this guide help you to install or upgrade existing PHP 5 with PHP 7 on CentOS 7 Linux server using Remi Repository.

Check the current PHP version

In this example when we run php version command showing us the PHP version 5.6

php –version
PHP 5.6.22 (cli) (built: Jun 21 2016 23:30:46)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
  1. First we download Remi and EPEL Repository packages

    wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  2. after download complete now we need to Enable Remi and EPEL Repository , we can enable PHP 70 ,PHP 71

    rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
    FOR PHP 7.0
    yum-config-manager –enable remi-php70
    FOR PHP 7.1
    yum-config-manager –enable remi-php71
  3. Now we are ready to install or upgrade the PHP to php version 7

    FOR New Installation
    yum install php
    FOR Upgrade
    yum update
  4. Now check again the currnet PHP version :

    php –version
    PHP 7.1.0 (cli) (built: Dec 1 2016 08:13:15) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
XsoftHost Support

Share

Recent Posts

Add Extra IP addresses to server configuration On Ubuntu 17.10 and later

Each failover IP address will need its own line in the configuration file. The configuration…

3 years ago

Create RAID Arrays with mdadm on Ubuntu

What is mdadm? The mdadm utility can be used to create and manage storage arrays…

4 years ago

How to change the maximum upload file size for PHP

There are several scenarios that you might need to increase or decrease your php maximum…

6 years ago

How to install Let’s Encrypt Plugin in WHM/cPanel

What is Let’s Encrypt? Let’s Encrypt is a free certificate authority provided by the Internet…

6 years ago

How to install python in my cPanel and add py extension

Python normally installed on all cPanel hosting server because most of Centos/red hat update system…

6 years ago

How to install and enable GUI GNOME Desktop on centos 7

Usually CentOS 7 comes in a numbers of variants, For most users, there are two…

6 years ago