ChatGPT解决这个技术问题 Extra ChatGPT

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

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question

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?

I have it in php /ext directory.
@joci, see this answer.
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?
I'm using Windows with apache server(MAMP). Yes, I restarted server.
mbstring settings uncommented in php.ini?

s
steven
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

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.
also apt-get install php7.1-mbstring works for me
If running this returns an error of Unable to locate package php-mbstring, try running sudo apt-get update first.
And of course, apt-get install php7.2-mbstring
confirmed working (sudo apt-get install php7.2-mbstring) on ubuntu php 7.2.24
J
Jens A. Koch

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.


I reinstalled server, but nothing has changed.
That's odd. Maybe ask for support over at MAMP or simply switch the stack.. XAMPP, WPN-XM.
I finally solved it. I set PHPRC variable and uncommented zend_extension=php_opcache.dll in php.ini.
And also I installed C++ redistributable and directx. I don't know where was a problem, but it works perfect now.
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.
M
Michel

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!


this do not work for me, which repo are you using?
On Ubuntu 18 it worked as above.
c
cchapman

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


Can you explain better what you did please?