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?
Asked
Active
Viewed 1.4e+01k times
110

Jozef Cipa
- 2,133
- 3
- 15
- 29
-
I have it in php /ext directory. – Jozef Cipa Sep 09 '15 at 20:51
-
@joci, see [this answer](http://stackoverflow.com/a/18849044/1252947). – Pedro Pinheiro Sep 09 '15 at 20:52
-
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? – Jonathan Kuhn Sep 09 '15 at 20:56
-
I'm using Windows with apache server(MAMP). Yes, I restarted server. – Jozef Cipa Sep 10 '15 at 05:44
-
`mbstring` settings uncommented in `php.ini`? – Nikolaj Sarry Sep 10 '15 at 14:55
-
It has own settings in php.ini ? I thought of just uncomment extension. If it has own settings I look at it. – Jozef Cipa Sep 10 '15 at 15:23
-
@joci If you found the answer as a solution to your problem, please mark it as the answer. – notANerdDev Dec 10 '15 at 17:59
4 Answers
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
-
19This 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
-
4If 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
-
1confirmed working (sudo apt-get install php7.2-mbstring) on ubuntu php 7.2.24 – dataviews Dec 16 '19 at 12:10
22
- find your
php.ini
- make sure the directive
extension_dir=C:\path\to\server\php\ext
is set and adjust the path (set your PHP extension dir) - 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
-
-
That's odd. Maybe ask for support over at MAMP or simply switch the stack.. XAMPP, WPN-XM. – Jens A. Koch Sep 10 '15 at 14:16
-
I finally solved it. I set PHPRC variable and uncommented zend_extension=php_opcache.dll in php.ini. – Jozef Cipa Sep 14 '15 at 11:27
-
And also I installed C++ redistributable and directx. I don't know where was a problem, but it works perfect now. – Jozef Cipa Sep 14 '15 at 11:37
-
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. – astrosixer Dec 16 '19 at 19:13
-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