Composer-请求的 PHP 扩展 mbstring 在您的系统中丢失了

我最近尝试通过 Composer 安装软件包,但是我得到了一个错误 the requested PHP extension mbstring is missing from your system. 我从 php.ini中删除了分号,但它仍然不工作。我该怎么办?

132523 次浏览
  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.

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

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

For php 7.1

sudo apt-get install php7.1-mbstring

Cheers!