laravel 即使安装了 Composer,也找不到 ext-mbstring

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28333785/
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-09-14 10:50:10  来源:igfitidea点击:

Composer can't find ext-mbstring even though it is installed

phpwindowslaravelcomposer-phpmbstring

提问by CoCoMonk

When I attempt to install Laravel 5 I get a dependency error. I'm using Uniform Server on Windows 7. I have enabled php_mbstring.dll and I checked it's loading properly. (I think)

当我尝试安装 Laravel 5 时,出现依赖项错误。我在 Windows 7 上使用 Uniform Server。我启用了 php_mbstring.dll 并检查它是否正确加载。(我认为)

Here is the console output (Composer):

这是控制台输出(作曲家):

Composer dependency error when installing laravel 5

安装 Laravel 5 时 Composer 依赖错误

Here are the extensions in my php.ini Php.ini extensions

这是我的 php.ini 中的扩展名 php.ini 扩展

Here are the phpinfo() mbstring details: mbstring installed

这是 phpinfo() mbstring 的详细信息: 安装了 mbstring

I don't know where to go from here. Any idea?

我不知道从这里去哪里。任何的想法?

回答by Simone Cabrino

Pay attention that, both in Windows and Linux, PHP can run with multiples php.ini configuration files.

请注意,在 Windows 和 Linux 中,PHP 可以运行多个 php.ini 配置文件

In general, when you find this kind of issue, you have to double check that the configuration file loaded is the same that you are editing or you need to find the right path and add the extension also to the right php.ini configuration file.

通常,当您发现此类问题时,您必须仔细检查加载的配置文件是否与您正在编辑的配置文件相同,或者您需要找到正确的路径并将扩展名也添加到正确的 php.ini 配置文件中。

While running a script through a web server, you can find the configuration file using the function

通过Web服务器运行脚本时,您可以使用该功能找到配置文件

phpinfo();

and checking the line "Loaded Configuration File" (or just look for php.ini) PHP Info Screenshot

并检查“加载的配置文件”行(或只查找 php.ini) PHP 信息截图

For what concern the CLI you can run in CMD

对于 CLI 的问题,您可以在 CMD 中运行

php --ini

and check the first lines in order to find the Loaded Configuration File value.

并检查第一行以找到加载的配置文件值。