Monday, January 8, 2018

How to Upgrade PHP version to 7.0 in CentOS 6/7

Add yum repository information

Before installing, you need to add the yum repository information for the corresponding CentOS version using the rpm command.
CentOS 6.x:
# rpm -Uvh
# rpm -Uvh
CentOS 7.x:
# rpm -Uvh
# rpm -Uvh

Upgrade PHP

Now you can install PHP 7.0’s mod_php SAPI (along with an opcode cache) by running the following command in the terminal
# yum install php70w php70w-opcache
Important note
If we would like to upgrade php to this version it is recommended that you first check whether your system will support the upgrade. For example you can validate this, if any CPanel like software runs fine after the upgrade. Unless you know what you are doing it is risky to upgrade an existing system.
If you are confident that the upgrade will support the system, then proceed to upgrade PHP using the following commands,
# yum install yum-plugin-replace
# yum replace php-common --replace-with=php70w-common

Verify the upgrade

Once the upgrade process is finished, you can verify the installation by running the following command in your terminal,
# php -version
If the php has been upgraded successfully, you will receive the following output,
PHP 7.0.15 (cli) (built: Jan 19 2017 21:55:34) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

No comments:

Post a Comment

TicTic v2.2 - Android media app for creating and sharing short videos

Facebook Twitter Tiktik – Android app for creating and sharing short videos. The customizable social video application to build ...

Popular Posts