1

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?

0

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. – Alavi1412 Jan 8 '18 at 11:25
0

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.

  • Hello and welcome to StackExcange! it's not complete answer. Any advices (not compete answers) should be posted as comments bellow question/answer. – Yurij Goncharuk Mar 30 '18 at 14:48
0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.