标签:sudo conflict package ack nsa 解决 冲突 odi cts
CentOS自带了PHP5,安装PHP7.2的时候会遇到一些冲突.
参考:https://blog.csdn.net/xieliang5210/article/details/87157892
首先获取rpm:
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
1
2
然后可以利用 sudo yum list php*查看目前都有php的什么版本了,可以发现从4-7.2的版本都有,7.2版本名为72w,因此安装该版本即可:
sudo yum -y install php72w
1
遇到问题:
Transaction check error:
file /etc/httpd/conf.d/php.conf from install of mod_php72w-7.2.14-1.w7.x86_64 conflicts with file from package php-5.4.16-46.el7.x86_64
file /etc/httpd/conf.modules.d/10-php.conf from install of mod_php72w-7.2.14-1.w7.x86_64 conflicts with file from package php-5.4.16-46.el7.x86_64
错误概要
-------------
1
2
3
4
5
6
解决:
yum -y remove php-5.4.16-46.el7.x86_64
1
但安装完毕后,输入php -v发现并没有该命令,因为php72w只是安装了php最小的库,一些应用还未安装,因此安装一些拓展包即可:
yum -y install php72w-cli php72w-common php72w-devel php72w-mysql
1
遇到问题:
错误:php72w-common conflicts with php-common-5.4.16-46.el7.x86_64
您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest
1
2
3
解决:
yum -y remove php-common-5.4.16-46.el7.x86_64
1
然后输入php -v出现如下信息:
PHP 7.2.14 (cli) (built: Jan 12 2019 12:47:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologie
标签:sudo conflict package ack nsa 解决 冲突 odi cts
原文地址:https://www.cnblogs.com/yeyu1314/p/10986695.html