104

I've recently tried to install package through Composer, but I have got an error the requested PHP extension mbstring is missing from your system. I removed semicolon from php.ini, but it still doesn't work. What should I do?

Jozef Cipa
  • 1,865
  • 3
  • 12
  • 25

4 Answers4

239
sudo apt-get install php-mbstring

# if your are using php 7.1
sudo apt-get install php7.1-mbstring

# if your are using php 7.2
sudo apt-get install php7.2-mbstring
S.M.
  • 13,389
  • 7
  • 29
  • 39
Pranay Aryal
  • 4,602
  • 2
  • 25
  • 36
  • 16
    This worked but I had to install the specific php version: `sudo apt-get install php5.6-mbstring`. Do a search with `apt-cache search mbstring` to see which versions are available for your system. – Bjorn Aug 02 '16 at 00:51
  • 10
    also `apt-get install php7.1-mbstring` works for me – Danon Feb 16 '17 at 15:07
  • 3
    If running this returns an error of `Unable to locate package php-mbstring`, try running `sudo apt-get update` first. – matt Jan 31 '18 at 19:31
  • 2
    And of course, `apt-get install php7.2-mbstring` – Mike Bird Feb 08 '18 at 03:23
  • 1
    confirmed working (sudo apt-get install php7.2-mbstring) on ubuntu php 7.2.24 – dataviews Dec 16 '19 at 12:10
21
  1. find your php.ini
  2. make sure the directive extension_dir=C:\path\to\server\php\ext is set and adjust the path (set your PHP extension dir)
  3. make sure the directive extension=php_mbstring.dll is set (uncommented)

If this doesn't work and the php_mbstring.dll file is missing, then the PHP installation of this stack is simply broken.

Jens A. Koch
  • 34,456
  • 12
  • 100
  • 117
7

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!

Michel
  • 867
  • 11
  • 23
-1

I set the PHPRC variable and uncommented zend_extension=php_opcache.dll in php.ini and all works well.

cchapman
  • 2,668
  • 6
  • 42
  • 59
Jozef Cipa
  • 1,865
  • 3
  • 12
  • 25