Error: php72w-common conflicts with php-common-5.4.16

created at 07-07-2021 views: 2

problem

I found an error when running my colleague's project today

Uncaught Error: Call to undefined function bcdiv()

The reason is that the bcmath extension is not enabled in the local php environment, so I use the command to install it directly:

[root@k8s-master /]# yum install php-bcmath

The error is as follows

Error: php72w-common conflicts with php-common-5.4.16-48.el7.x86_64

Solution

Install the two sources epel + Remi. The Remi repository is a Linux source containing the latest versions of PHP and MySQL packages, and is maintained by Remi.

yum install epel-release.noarch
//Install the source of remi's centos7
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
//The source of this remi needs to be modified after installation to make it effective. I am using version 7.2 here
vi /etc/yum.repos.d/remi-php72
Change enabled=0 to enabled=1
Then execute
[root@k8s-master /]# yum install php-bcmath
php
Please log in to leave a comment.