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


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

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

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
  1. 查找php.ini
  2. 确保指令extension_dir=C:'path'to'server'php'ext设置并调整路径(设置您的PHP扩展目录)
  3. 确保指令extension=php_mbstring.dll已设置(未注释)

如果这不起作用并且php_mbstring.dll文件丢失,那么这个堆栈的PHP安装就被破坏了。

For php 7.1

sudo apt-get install php7.1-mbstring

干杯!

我在php.ini中设置了PHPRC变量和未注释的zend_extension=php_opcache.dll,一切都运行良好。