致命错误:在第 177 行调用 C:\apache\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc 中未定义的函数 mb_detect_encoding()
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22271260/
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
Fatal error: Call to undefined function mb_detect_encoding() in C:\apache\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177
提问by Luminusss
So I'm trying to get phpmyadmin running on windows 7, and I've gone through and installed all the proper programs/files (apache, mySQL, php, etc..) and i have the phpmyadmin folder in the right place in my directory, such that when I try to access it in my browser when the directory index is set to index.html it shows the whole directory. However, when I switch the directory to index.php i'm getting this error:
所以我试图让 phpmyadmin 在 Windows 7 上运行,我已经完成并安装了所有正确的程序/文件(apache、mySQL、php 等),并且我在我的正确位置有 phpmyadmin 文件夹目录,这样当我尝试在浏览器中访问它时,当目录索引设置为 index.html 时,它会显示整个目录。但是,当我将目录切换到 index.php 时,出现此错误:
Fatal error: Call to undefined function mb_detect_encoding() in C:\apache\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177
Fatal error: Call to undefined function mb_detect_encoding() in C:\apache\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177
I've looked at a few support pages and everything (such as this one) but all of the suggestions don't seem to be helping me out. Most of them talk about editing the php.ini file in the /php folder, but I don't even have that, I have a php.ini-developmentand php.ini-productionfile and thats it. Suggestions?? I have also tried reinstalling php to see if it was an issue with the installation...didn't work. Please help!
我查看了一些支持页面和所有内容(例如这个),但所有建议似乎都没有帮助我。他们中的大多数人都在谈论编辑 /php 文件夹中的 php.ini 文件,但我什至没有那个,我有一个php.ini-development和php.ini-production文件,仅此而已。建议??我还尝试重新安装 php 以查看它是否是安装问题...不起作用。请帮忙!
回答by Luminusss
The issue was caused by some of the extensions being blocked and the extension directory not being fully set.
该问题是由于某些扩展被阻止并且扩展目录未完全设置引起的。
In the php.ini file extension_dir=needs to be set to "C:\php\ext" or whereever the php ext file is located. Also the following extensions need to be uncommented in the php.ini file as well
在 php.ini 文件中extension_dir=需要设置为 "C:\php\ext" 或者 php ext 文件所在的任何位置。此外,还需要在 php.ini 文件中取消注释以下扩展名
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysqli.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysqli.dll
Another thing that helps is to go in to the php\ext folder, right click on each of the above exts and select unblockand make sure they are not set to read-only.
另一件有帮助的事情是进入 php\ext 文件夹,右键单击上述每个 ext 并选择unblock并确保它们未设置为只读。
回答by Akash
Rename the php.ini-development to php.ini and enable/add
将 php.ini-development 重命名为 php.ini 并启用/添加
extension=mysqli.dll
extension=mbstring.dll
Do restart apache after this change
在此更改后重新启动 apache

