11

i've tried to install the extension mbstring but i have the following error:

    Error: Package: php-mbstring-5.4.16-23.el7_0.3.x86_64 (updates)
        Requires: php-common(x86-64) = 5.4.16-23.el7_0.3
        Installed: php-common-5.4.38-1.el7.remi.x86_64 (@remi)
        php-common(x86-64) = 5.4.38-1.el7.remi
        Available: php-common-5.4.16-21.el7.x86_64 (base)
        php-common(x86-64) = 5.4.16-21.el7
        Available: php-common-5.4.16-23.el7_0.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0
        Available: php-common-5.4.16-23.el7_0.1.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0.1
        Available: php-common-5.4.16-23.el7_0.3.x86_64 (updates)
        php-common(x86-64) = 5.4.16-23.el7_0.3
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

What could i do to resolve the problem ?

Thanks for your help

KrqcS
  • 351
  • 1
  • 2
  • 7

9 Answers9

20

For people who want to know how to solve this :

sudo yum remove php-common

Then you can:

sudo yum install php-mbstring

It will automaticcaly install dependecies (php-common)

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
KrqcS
  • 351
  • 1
  • 2
  • 7
15

This answer from AWS Amazon forum:

yum -y install yum-utils
yum repolist all
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

Then you can install php-mbstring, and maybe, I don't know exactly, but maybe it can help for servers on Amazon only.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
DeamonMV
  • 722
  • 1
  • 10
  • 19
10

need to search which mbstring version required you.

cat /etc/redhat-release && php -v && yum search mbstring



========================================================================= N/S matched: mbstring ==========================================================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php73-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling

now you can check what you actually need like i am using php7.1 so my command will be

sudo yum install ea-php71-php-mbstring
Hassan Ali Shahzad
  • 2,439
  • 29
  • 32
  • 1
    It work for me, if you manage server that install php with cpanel, this is the correct answer – Suhendra Nov 17 '19 at 18:15
  • Upvoted initially, because of the elegant search command. However on my Centos 7.9 system (php 5.6 from remi repo), a normal `yum install php-mbstring` did the trick, while the `yum install php56-php-mbstring` did not. You can check with `php -m | grep mb` it should return `mbstring` – ionescu77 Nov 04 '22 at 12:41
7

The selected answer is liable to change the installed PHP version. When not using the stock CentOS PHP, yum will try to install the mbstring extension for the wrong version of PHP.

You can check your installed PHP version with php -v:

$ php -v
PHP 5.5.36 (cli) (built: May 28 2016 12:05:32)

Then go ahead and install the correct mbstring version for your installed PHP version:

$ sudo yum install php55w-mbstring
dotancohen
  • 30,064
  • 36
  • 138
  • 197
5

You must specify the same version as your php-common, mine is php70w-common

 sudo yum install php70w-mbstring
ekerner
  • 5,650
  • 1
  • 37
  • 31
5

Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6

Instead, you should

Install the mbstring PHP Extension with EasyApache

check if you already have it by, putty or ssh

php -m | grep mbstring

[if nothing, means missing mbstring]

Now you need to goto godaddy your account page,

click manager server,

open whm ----- search for apache,

open "easy apache 4"(my case)

Now you need customize currently installed packages,

by

click "customize" button on top line next to "currently installed package..."

search mbstring,

click on/off toggle next to it.

click next, next, .... privision..done.

Now you should have mbstring

by check again at putty(ssh)

php -m | grep mbstring [should see mbstring]

or you can find mbstring at phpinfo() page

hoogw
  • 4,982
  • 1
  • 37
  • 33
4

Been searching for the answer for half day, then only realise cPanel / WHM version of CentOS will disable YUM to update php. You shall remove php* from exclude list in /etc/yum.conf.

....

Ashvin Bhagat
  • 213
  • 4
  • 14
Mark Khor
  • 396
  • 5
  • 7
4

Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6

Instead, you should install the mbstring PHP Extension with EasyApache check if you already have it by, putty or ssh

php -m | grep mbstring       [if nothing, means missing mbstring]

Now you need to go to godaddy your account page,

1.click manager server,

2.open whm ----- search for apache,

3.open "easy apache 4"(my case)

Now you need customize currently installed packages,by

4.click "customize" button on top line next to "currently installed package..."

5.In the search bar write "mbstring",

6.click on/off toggle next to it.

7.click next, next, .... privision..done.

Now you should have mbstring by check again at putty(ssh)

php -m | grep mbstring         [should see mbstring]

or you can find mbstring at phpinfo() page

Thanks, my problem is done

bruno
  • 128
  • 1
  • 3
phe
  • 41
  • 1
3

Fedora 28 (Cloud Edition)

sudo yum install php56-php-mbstring
sudo yum install php70-php-mbstring
sudo yum install php71-php-mbstring
sudo yum install php72-php-mbstring
sudo yum install php73-php-mbstring

V.Tran
  • 97
  • 5