I have installed PHP version 7 on my centOs.

Now I got an error says:

undefined function mb_internal_encoding()

So I decided to install php-mbstring (using yum install php-mbstring) but I face the following error:

Error: php70u-common conflicts with php-common-5.4.16-43.el7_4.x86_64

Error: php70u-json conflicts with php-common-5.4.16-43.el7_4.x86_64

But now when I install php-mbstring, it wants to install php-mbstring version 5.4.

How can I tell yum to download latest versions of php extensions and packages?

3 Answers 3


You've both php5 and php7 installed in your system which is creating conflict. If you're using php7 only then remove another version using

yum remove php-*

Install the necessary php7 packages only after complet removal of older version. If you need multiple versions of php to be installed, please google for particular procedure. It's not very simple.

Note While removing softwares with wildcards remember to check what yum is going to remove before proceeding further.

  • It didn't work, I have delete whole php twice.
    – Leo
    Jan 8, 2018 at 11:25

Run this:

yum remove php php-cli php-common php-gd php-ldap php-mysql php-odbc php-pdo php-pear php-pecl-apc php-pecl-memcache php-pgsql php-soap php-xml php-xmlrpc -y

Now run yum install php-mbstring

This should help you.


If you need both the official centos php (5.4) and a newer one being simultaneously installed in your system, IUS repository offers packages with newer releases than centos/epel repos and is using different naming (e.g. php56u, php70u...) to prevent conflicts.

Using ius repository is described here : https://ius.io/GettingStarted/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .