尝试访问phpmyadmin mb_detect_encoding时发生PHP致命错误 [英] PHP Fatal error when trying to access phpmyadmin mb_detect_encoding

查看:97
本文介绍了尝试访问phpmyadmin mb_detect_encoding时发生PHP致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道发生了什么,但是下面是尝试访问phpmyadmin时日志给我的信息,请帮忙.尝试调试另一个问题并遇到了这个问题.确实不可能恢复到正常工作时的状态.

Not sure what happened, but below is what the log is giving me when trying to access phpmyadmin, please help. Trying to debug a different problem and ran into this. Not really possible to revert back to when it was working.

PHP致命错误:调用未定义函数mb_detect_encoding() /usr/share/php/gettext/gettext.inc,第177行

PHP Fatal error: Call to undefined function mb_detect_encoding() in /usr/share/php/gettext/gettext.inc on line 177

当尝试访问该网站时,出现此错误,我认为这两个错误很可能相关:

When trying to go the the site, I get this error, I think it's likely the two errors are related:

数据库连接错误(1):MySQL适配器'mysqli'不可用.

Database connection error (1): The MySQL adapter 'mysqli' is not available.

推荐答案

第一个错误是由php引起的,因为扩展名mbstring未安装或未激活.

First error is caused by php because the extension mbstring is either not installed or not active.

第二个错误是phpMyAdmin/您的站点的输出,要求您安装/启用mysqli扩展.

The second error is output of phpMyAdmin/your site asking you to install / enable the mysqli extension.

要启用mbstring和mysqli,请编辑您的php.ini,并在UNIX上使用mbstring.so和mysqli.so或在Windows上使用mbstring.dll和mysqli.dll添加/取消注释这两行

To enable mbstring and mysqli edit your php.ini and add/uncomment the two lines with mbstring.so and mysqli.so on unix or mbstring.dll and mysqli.dll on windows

Unix/etc/(phpX/)php.ini

Unix /etc/(phpX/)php.ini

extension=mysqli.so
extension=mbstring.so

Windows PHP安装文件夹\ etc \ php.ini

Windows PHP installation folder\etc\php.ini

extension=mysqli.dll
extension=mbstring.dll

别忘了在此之后重新启动您的Web服务器.

Don't forget to restart your webserver after this.

用户在评论中添加了他使用redhat的功能,因此这是在所有基于CentOS/Fedora/RedHat/Yum的Linux发行版上安装扩展的方法

User added he was using redhat in the comments so here's how you install extensions on all CentOS/Fedora/RedHat/Yum based linux distros

sudo yum install php-mysqli
sudo yum install php-mbstring

restart your werbserver
sudo /etc/init.d/httpd restart

您可以在文档根目录中使用一个小的php脚本来验证安装. 这列出了您为php安装的所有设置,版本和有效扩展

you can verify your installation with a little php script in your document root. This lists all settings, versions and active extensions you've installed for php

test.php

<?php
phpinfo();

这篇关于尝试访问phpmyadmin mb_detect_encoding时发生PHP致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆