110

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
  • 2,133
  • 3
  • 15
  • 29

4 Answers4

252
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

# if your are using php 7.4
sudo apt-get install php7.4-mbstring
steven
  • 4,868
  • 2
  • 28
  • 58
Pranay Aryal
  • 5,208
  • 4
  • 30
  • 41
  • 19
    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
  • 4
    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` – MikeBird 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
22
  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
  • 39,862
  • 13
  • 113
  • 141
8

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!

Michel
  • 1,085
  • 13
  • 24
-1

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

cchapman
  • 3,269
  • 10
  • 50
  • 68
Jozef Cipa
  • 2,133
  • 3
  • 15
  • 29