无法使用PHP 7初始化mbstring [英] Cannot Initialize mbstring with PHP 7
问题描述
每当我尝试访问phpMyAdmin时,都会出现以下错误:
Whenever I try to access phpMyAdmin, I receive the following error:
"缺少mbstring扩展名.请检查您的PHP配置."
"The mbstring extension is missing. Please check your PHP configuration."
我正在CentOS 7服务器上运行LEMP堆栈.我选择使用PHP 7进行此安装.在运行早期版本的PHP的相同设置上,我还没有遇到此错误.
I am running a LEMP stack on a CentOS 7 server. I have elected to use PHP 7 for this installation. I have not experienced this error on identical set-ups running earlier versions of PHP.
extension_loaded('mbstring')
也会返回false:
extension_loaded('mbstring')
returns false even though mbstring.ini (/etc/php.d/) contains:
; Enable mbstring extension module
extension=mbstring.so
我100%确定服务器上已安装mbstring模块.
I am 100% sure that the mbstring module is installed on my server.
我很沮丧,所以如果有人有任何想法,请告诉我.谢谢.
I'm completely stumped so if anyone has any ideas whatsoever, please let me know. Thanks.
推荐答案
使用以下方法达成了解决方案:
A solution was reached with the following method:
我将extension=mbstring.so
放在php.ini中,尽管这不再是PHP默认使用的用于加载模块的方法.
I put extension=mbstring.so
inside php.ini even though that is no longer the method PHP uses by default to load modules.
来自php.ini本身:
From php.ini itself:
注意:打包的扩展模块现在通过目录/etc/php.d中的.ini文件加载;这些是默认加载的.
Note: packaged extension modules are now loaded via the .ini files found in the directory /etc/php.d; these are loaded by default.
这似乎解决了我的问题.我还是很想听听其他人对此事是否有不同看法.
It seemed to fix my problem. I would still be interested to hear if anyone else has a different take on this matter.
这篇关于无法使用PHP 7初始化mbstring的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!