Composer - the requested PHP extension mbstring is missing from your system [closed]
Asked Answered
G

4

112

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?

Groscr answered 9/9, 2015 at 20:48 Comment(7)
I have it in php /ext directory.Groscr
@joci, see this answer.Construction
What OS are you using (linux/mac/windows)? What webserver are you using (iis/nginx/apache/etc)? Have you restarted the webserver software since updating the php.ini file?Platto
I'm using Windows with apache server(MAMP). Yes, I restarted server.Groscr
mbstring settings uncommented in php.ini?Overheat
It has own settings in php.ini ? I thought of just uncomment extension. If it has own settings I look at it.Groscr
@joci If you found the answer as a solution to your problem, please mark it as the answer.Almemar
G
-1

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

Groscr answered 10/12, 2015 at 20:57 Comment(1)
Can you explain better what you did please?Malcommalcontent
T
255
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
Township answered 20/5, 2016 at 4:24 Comment(5)
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.Onfroi
also apt-get install php7.1-mbstring works for meSunda
If running this returns an error of Unable to locate package php-mbstring, try running sudo apt-get update first.Bega
And of course, apt-get install php7.2-mbstringTitanism
confirmed working (sudo apt-get install php7.2-mbstring) on ubuntu php 7.2.24Zischke
A
23
  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.

Anvers answered 10/9, 2015 at 11:0 Comment(5)
I reinstalled server, but nothing has changed.Groscr
That's odd. Maybe ask for support over at MAMP or simply switch the stack.. XAMPP, WPN-XM.Anvers
I finally solved it. I set PHPRC variable and uncommented zend_extension=php_opcache.dll in php.ini.Groscr
And also I installed C++ redistributable and directx. I don't know where was a problem, but it works perfect now.Groscr
In my case there was no line for the extension php_mbstring in php.ini file. So I installed it using sudo apt-get install php7.3-mbstring. My php version is 7.3 and it worked like charm.Homotaxis
A
8

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!

Aerodontia answered 3/3, 2018 at 19:55 Comment(2)
this do not work for me, which repo are you using?Malcommalcontent
On Ubuntu 18 it worked as above.Gonsalves
G
-1

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

Groscr answered 10/12, 2015 at 20:57 Comment(1)
Can you explain better what you did please?Malcommalcontent

© 2022 - 2024 — McMap. All rights reserved.