简体   繁体   English

Phpmyadmin 显示缺少 mbstring

[英]Phpmyadmin showing mbstring is missing

I have using PHP 7.2 version,and modules list is given below:我使用PHP 7.2版本,模块列表如下:

php -m

[PHP Modules]

bz2
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
openssl
pcntl
pcre
PDO
Phar
Reflection
session
SimpleXML
soap
sodium
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

In this list it shows mbstring but in info.php on browser it doesn't has mbstring when i searched...anyone please help me for this issue.在此列表中,它显示mbstring ,但在浏览器上的info.php中,当我搜索时它没有mbstring ...任何人请帮我解决这个问题。

Thanks in advance.提前致谢。

The cli and apache or nginx module have different config paths and, probably, different configs. cliapachenginx模块具有不同的配置路径,并且可能具有不同的配置。 Your module is enabled on cli but disabled to web .您的模块在cli上启用但对web禁用。

You need to check your php.ini您需要检查您的php.ini

If you try to do this (on terminal):如果您尝试这样做(在终端上):

$ php -a
phpinfo();

In a point you can see the php.ini path.在某一点上,您可以看到php.ini路径。

Do the same thing on your www directory creating a phpinfo.php and calling the phpinfo() function and check the php.ini path.在您的www目录上执行相同的操作,创建phpinfo.php并调用phpinfo() function 并检查php.ini路径。

Probably is not the same path and not the same configurations because we have a ini file to cli and to the apache/nginx module.可能不是相同的路径和不同的配置,因为我们有一个用于cliapache/nginx模块的ini文件。 So, you can fix it seeing which file is loading the modules and point to enable the module on web.因此,您可以修复它,查看哪个文件正在加载模块并指向启用 web 上的模块。

If is in different path, probably you'll need to enable or install the mbstring module on web version.如果在不同的路径中,您可能需要在 web 版本上启用或安装mbstring模块。

Considering that you're using php-fpm you can install mbstring module with the following command:考虑到您使用的是php-fpm ,您可以使用以下命令安装mbstring模块:

php-fpm install mbstring

In case of Windows ,Windows的情况下,

  1. Edit the php.ini file编辑php.ini文件
  2. update extension_dir = "ext" to extension_dir = "C:\php\ext" (may vary based on your system) extension_dir = "ext" to extension_dir = "C:\php\ext" (可能因您的系统而异)
  3. Remove semicolon from ;extension=php_mbstring.dll and change it to extension=php_mbstring.dll;extension=php_mbstring.dll中删除semicolon并将其更改为extension=php_mbstring.dll
  4. You also need to enable mcrypt as well by uncomment/remove semicolon from ;extension=php_mcrypt.dll .您还需要通过从;extension=php_mcrypt.dll取消注释/删除分号来启用 mcrypt。 (Generally phpmyadmin also gives error for mcrypt ) (通常 phpmyadmin 也会给出mcrypt错误)
  5. Save your php.ini file保存您的 php.ini 文件
  6. Restart the apache server重启apache服务器

For ubuntu ,对于ubuntu

  1. Open terminal打开终端
  2. Enter command sudo apt-get install php-mbstring php7.0-mbstring php-gettext libapache2-mod-php7.0输入命令sudo apt-get install php-mbstring php7.0-mbstring php-gettext libapache2-mod-php7.0
  3. Restart apache sudo systemctl restart apache2重启 apache sudo systemctl restart apache2

If above method doesn't work, explicitly enable mbstring and mcrypt extensions:如果上述方法不起作用,请显式启用 mbstring 和 mcrypt 扩展:

sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2

Hope it works for you!!希望这对你有用!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM