TransWikia.com

Yum install php v5.4 packages while I have installed php 7

Unix & Linux Asked on December 4, 2021

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

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/

Answered by tonioc on December 4, 2021

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.

Answered by Akhil on December 4, 2021

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.

Answered by Abhik Bose on December 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP