Composer - the requested PHP extension mbstring is missing from your system

PhpComposer PhpMbstring

Php Problem Overview


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?

Php Solutions


Solution 1 - Php

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

Solution 2 - Php

  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.

Solution 3 - Php

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!

Solution 4 - Php

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJozef CipaView Question on Stackoverflow
Solution 1 - PhpPranay AryalView Answer on Stackoverflow
Solution 2 - PhpJens A. KochView Answer on Stackoverflow
Solution 3 - PhpMichelView Answer on Stackoverflow
Solution 4 - PhpJozef CipaView Answer on Stackoverflow