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
First we download Remi and EPEL Repository packages
wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpmwget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmafter 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.rpmFOR PHP 7.0yum-config-manager –enable remi-php70FOR PHP 7.1yum-config-manager –enable remi-php71Now we are ready to install or upgrade the PHP to php version 7
FOR New Installationyum install phpFOR Upgradeyum updateNow check again the currnet PHP version :
php –versionPHP 7.1.0 (cli) (built: Dec 1 2016 08:13:15) ( NTS )Copyright (c) 1997-2016 The PHP GroupZend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies