Composer - 您的系统中缺少请求的 PHP 扩展 mbstring

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32488917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:00:29  来源:igfitidea点击:

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

phpcomposer-phpmbstring

提问by Jozef Cipa

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?

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

采纳答案by Jozef Cipa

I set the PHPRC variable and uncommented zend_extension=php_opcache.dllin php.iniand all works well.

我设置了PHPRC变量和注释掉zend_extension=php_opcache.dllphp.ini和一切运作良好。

回答by Pranay Aryal

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

回答by Jens A. Koch

  1. find your php.ini
  2. make sure the directive extension_dir=C:\path\to\server\php\extis set and adjust the path (set your PHP extension dir)
  3. make sure the directive extension=php_mbstring.dllis set (uncommented)
  1. 找你的 php.ini
  2. 确保extension_dir=C:\path\to\server\php\ext设置了指令并调整路径(设置您的 PHP 扩展目录)
  3. 确保extension=php_mbstring.dll设置了指令(未注释)

If this doesn't work and the php_mbstring.dll file is missing, then the PHP installation of this stack is simply broken.

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

回答by Michel

For php 7.1

对于 php 7.1

sudo apt-get install php7.1-mbstring

Cheers!

干杯!