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
Share on facebook
Share on twitter
Share on linkedin
Share on telegram
Share on whatsapp

Related Posts