Question

how to upgrade php 5.6 to php 7 in centos 6.6

Posted October 14, 2017 12k views
CentOS PHP

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.

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

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 ’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

  • base: centos.mirror.fr.planethoster.net
  • epel: mirrors.ircam.fr
  • extras: centos.mirror.ate.info
  • remi-php56: remirepo.reloumirrors.net
  • remi-php70: remirepo.reloumirrors.net
  • remi-safe: remirepo.reloumirrors.net
  • updates: mirrors.ircam.fr No package mod_php70u available. No package php70u-cli available. Error: Nothing to do
Submit an Answer