Report this

What is the reason for this report?

how to upgrade php 5.6 to php 7 in centos 6.6

Posted on October 14, 2017

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



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!

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.

After executing these 3 command lines it gave me this result curl ‘https://setup.ius.io/’ -o setup-ius.sh sudo bash setup-ius.sh sudo yum install mod_php70u php70u-cli

result,

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 'https://setup.ius.io/' -o setup-ius.sh
  2. sudo bash setup-ius.sh

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.