Install PHP7 from Remi repo

Solution 1:

By default "php70" (Software Collection) don't install the mod_php.

yum install php70-php

And check you haven't any other mod_php (such as the one provided by "php" base package)

Solution 2:

FYI for those looking to install PHP 7 using the remi-php70 repository (now that PHP 7.0.0 has been released), you can install packages using the same package names you know and love, for example:

  • php
  • php-cli
  • php-common
  • php-devel
  • php-fpm
  • php-gd
  • php-mbstring
  • php-pdo
  • etc.

Solution 3:

For anyone else trying to upgrade from PHP 5.6 to 7.0.1 on Centos 6.7:

I managed to get this working today almost like @mbalparda has listed but without using epel-release (though a few epel repos are enabled and in use)

I had php 5.6 from IUS (https://ius.io/GettingStarted/) repo (https://centos6.iuscommunity.org/ius-release.rpm) installed, so I removed them by:

# yum list installed | grep php5
php56u.x86_64          5.6.14-1.ius.centos6
php56u-cli.x86_64      5.6.14-1.ius.centos6
php56u-common.x86_64   5.6.14-1.ius.centos6
...

and so

# yum erase php56u php56u-cli php56u-common php56u-mcrypt php56u-mysqlnd ...

followed by the listed commands:

# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 
# rpm -Uvh remi-release-6.rpm
# yum install php70-php php70-php-cli php70-php-common php70-php-mcrypt php70-php-mysqlnd ...
# scl enable php70 'php -v'
# sudo ln -s /usr/bin/php70 /usr/bin/php
# service httpd restart

Solution 4:

PHP70 also seems to install everything under /etc/opt/remi/php70/:

you'll need to run:

source /opt/remi/php70/enable

Tags:

Php

Centos6