how to upgrade php 5.6 to php 7 in centos 6.6

Posted October 14, 2017 17.7k views

i have a Centos 6.6 with php 5.6, i need upgrade to php 7

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

CentOS 6 does not provide PHP 7, so you will need to use a third-party repository. Luckily, there are a number of community projects that provide more recent versions. In this case, we’ll use the packages from the IUS Project.

To add their repository, run:

  • curl '' -o
  • sudo bash

Now, you can install the newer PHP packages with:

  • sudo yum install mod_php70u php70u-cli

You can find more details in:

(That tutorial is targeted for at CentOS 7, but the information and caveats should still apply to CentOS 6 as well.)

by Brennen Bearnes
PHP 7.0 was released on December 3, 2015. It promises substantial speed improvements over previous versions of the language, along with new features like scalar type hinting. This guide explains how to quickly upgrade a PHP 5.x installation on a CentOS 7 system with Apache or Nginx, using community-provided packages.

After executing these 3 command lines it gave me this result
curl ’’ -o
sudo bash
sudo yum install mod_php70u php70u-cli


sudo yum install mod_php70u php70u-cli
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile

  • base:
  • epel:
  • extras:
  • remi-php56:
  • remi-php70:
  • remi-safe:
  • updates: No package mod_php70u available. No package php70u-cli available. Error: Nothing to do