以前在搭建LAMP server环境的时候,一直有一个问题困扰着我:
正常情况下,从光盘安装httpd的时候,只要这样就行:
yum install httpd httpd-* -y但是到了php的时候,就会遇到这样的提示:
…………
…………
--> Running transaction check
---> Package libtool-ltdl.x86_64 0:2.4.2-21.el7_2 will be installed
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package net-snmp-agent-libs.x86_64 1:5.7.2-24.el7_2.1 will be installed
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
--> Processing Conflict: php-mysql-5.4.16-42.el7.x86_64 conflicts php-mysqlnd
--> Finished Dependency Resolution
Error: php-mysql conflicts with php-mysqlnd-5.4.16-42.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest最开始我自己都是把不冲突的部分复制下来,然后手工粘贴在yum install后面安装,后来有一次看yum的man page,发现有 "--exclude"这个选项。
于是直接试了一下:
yum install php php-* --exclude php-mysql问题瞬间得到解决~

本文介绍了一种在使用yum安装PHP时解决与php-mysql冲突的方法。通过使用--exclude选项,可以轻松避开安装过程中的错误,确保顺利安装所需组件。

1636

被折叠的 条评论
为什么被折叠?



