Centos – PHP 7 conflicts with PHP 5 (Centos 7)

centoscentos7PHPyum

Trying to install PHP 7 now that it's available;

(on centos 7)

added repo's:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Then installed via:

yum install php70w php70w-opcache

Output is:

[root@host]# yum install php70w php70w-opcache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.advancedhosters.com
* epel: mirror.symnds.com
* extras: mirror.netdepot.com
* updates: mirrors.rit.edu
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php70w.x86_64 0:7.0.2-1.w7 will be installed
--> Processing Dependency: php70w-common(x86-64) = 7.0.2-1.w7 for package: php70w-7.0.2-1.w7.x86_64
--> Processing Dependency: php70w-cli(x86-64) = 7.0.2-1.w7 for package: php70w-7.0.2-1.w7.x86_64
--> Processing Dependency: php70w-cli = 7.0.2-1.w7 for package: php70w-7.0.2-1.w7.x86_64
---> Package php70w-opcache.x86_64 0:7.0.2-1.w7 will be installed
--> Running transaction check
---> Package php70w-cli.x86_64 0:7.0.2-1.w7 will be installed
---> Package php70w-common.x86_64 0:7.0.2-1.w7 will be installed
--> Processing Conflict: php70w-common-7.0.2-1.w7.x86_64 conflicts php-common < 5.5.0
--> Finished Dependency Resolution
Error: php70w-common conflicts with php-common-5.4.16-36.el7_1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

So the problem is : Error: php70w-common conflicts with php-common-5.4.16-36.el7_1.x86_64

How to fix this? I need both versions running simultaneously.

Best Answer

You can install php7 for C7 (and others) as a Software Collection (scl) This installs alongside the system provided php 5 and is entirely independent of it. You can find the php7 scl on the REMI repo. You may also be interested in this Q&A on SF.