how to upgrade php 5.6 to php 7 in centos 6.6

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

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

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:

  1. curl '' -o
  2. sudo bash

Now, you can install the newer PHP packages with:

  1. 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.)