php7.1.29找不到php.ini,php-致命错误:调用未定义函数mb_detect_encoding()

php-致命错误:调用未定义函数mb_detect_encoding()

在按照本教程尝试设置LAMP后,我收到此错误,并且在尝试设置phpmyadmin后发现上述错误。

致命错误:调用未定义函数mb_detect_encoding() C:\ WebServer \ Apache \ htdocs \ phpmyadmin \ libraries \ php-gettext \ gettext.inc 177行

我遵循了这里的建议:尝试访问phpmyadmin mb_detect_encoding时发生PHP致命错误,并进行了更改。

运行phpinfo()时,看到启用了对MySQL和mb_string的支持,如下所示:

EXZ5b.png

0ReUg.png

c85d5fd9f7023441f1c7765a4b76b7e5.png

Louis93 asked 2020-07-01T18:39:43Z

11个解决方案

41 votes

还安装gd库。

检查此链接[http://www.php.net/manual/zh/mbstring.installation.php]

Jibu K answered 2020-07-01T18:40:02Z

29 votes

有一种比重新编译PHP更简单的方法。 只需安装所需的mbstring库:

示例:如何在CentOS 6.2上安装PHP mbstring

yum --enablerepo=remi install php-mbstring

哦,别忘了之后重新启动apache。

Phil LaNasa answered 2020-07-01T18:40:30Z

8 votes

Mbstring是非默认扩展名。 这意味着默认情况下未启用它。 您必须使用configure选项显式启用模块。

如果您的php版本是7.0:

sudo apt-get install php7.0-mbstring

sudo service apache2 restart

如果您的php版本是5.6:

sudo apt-get install php5.6-mbstring

sudo service apache2 restart

BSB answered 2020-07-01T18:40:59Z

6 votes

在Windows上,打开文件php.ini并进行以下更改:

删除注释并指向ext目录

; extension_dir =“ ./”-> extension_dir =“ C:/ Php / ext”

删除此扩展程序的注释

扩展名= php_mbstring.dll

扩展名= php_mysqli.dll

重新启动apache服务

httpd -k重新启动

André Ribeiro answered 2020-07-01T18:41:49Z

3 votes

当我打开php.ini文件时,“ extension_dir”行如下所示:

extension_dir = "C:/wamp/bin/php/php5.4.16/ext/"

我改为:

extension_dir = "C:\wamp\bin\php\php5.4.16\ext\"

而且有效。

abhishek shringi answered 2020-07-01T18:42:17Z

2 votes

在Windows / WAMP下,GD2扩展,MySQL扩展或外部dll / lib似乎没有任何php_mbstring.dll依赖项:

extension_dir

php5ts.dll,OK

MSVCR110.dll,OK

KERNEL32.dll,OK

extension_dir

php5ts.dll,OK

USER32.dll,OK

GDI32.dll,OK

KERNEL32.dll,OK

MSVCR110.dll,OK

无论php_mbstring已经需要什么,它都是内置的(静态地直接编译到DLL中)。

调用未定义的函数mb_detect_encoding()

此错误也是非常具体且确定的...

函数extension_dir并未失败,因为未加载php_gd,php_mysql,php_mysqli或其他扩展名。 根本找不到。

我猜测所有报告为有效的答案(对于Windows / WAMP),即加载其他扩展名,更改php.ini extension_dir路径(如果开头错误,则不会加载任何扩展名), 等等,由于a)取消注释extension = php_mbstring.dll行,或b)重新启动Apache或计算机(以使更改生效),因此可以使工作更多。

在Windows上,大多数时候问题是php_mbstring.dll是:

被Windows阻止。 右键单击以解除阻止,然后选择“属性”。

否则由于无法加载另一个版本,PHP无法加载php_mbstring.dll(例如,从安装在C:\ Windows \ system32中的一些不正确的PHP DLL),某些版本不匹配,缺少运行时DLL等。请检查Apache和PHP的错误 首先获取日志文件以获取线索。

此处提供更深入的答案:调用未定义的函数mb_detect_encoding

rightstuff answered 2020-07-01T18:43:18Z

1 votes

如果您使用的是所有语言,则应仅使用英语版本的phpmyadmin,应在php.in文件中启用所有语言的mbstring .....只需在php.in中搜索mbstring

user2615161 answered 2020-07-01T18:43:38Z

1 votes

问题也可能是Apache找不到php.ini如果您错误地设置了PHPIniDir。我的设置为:PHPIniDir“ c:/ php7”但是,该文件夹实际上只是“ php”线索是查看phpinfo()其中显示:配置文件(php.ini)路径C:\ windows

ironarm answered 2020-07-01T18:43:58Z

1 votes

我在Ubuntu 17上遇到了相同的问题,Ispconfig无法处理任何排队的操作,并且server.sh命令也无法正常工作。我检查了一下,在操作系统升级后运行的PHP版本是7.1,因此解决方案是键入:

apt-get install php7.1-mbstring

现在一切正常

daniele cocilova answered 2020-07-01T18:44:22Z

0 votes

希望这可以帮助一些人,当我在php.ini文件中将路径和扩展名添加到“ docref_root”,“ docref_ext”时,出现此错误,然后我将其注释掉了,这没问题,但现在无法获得帮助。

Vasko answered 2020-07-01T18:44:42Z

0 votes

对于软呢帽:

yum install php-mbstring

然后重新启动Apache

user3413723 answered 2020-07-01T18:45:06Z

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --mandir=/usr/local/php/php/man --with-config-file-path=/usr/local/php/etc --with-mysql-sock=/var/run/mysql/mysql.sock --with-mcrypt=/usr /i nclude --with-mhash --with-openssl --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm --enable-fastcgi --with-fpm-user=www --with-fpm-group=www --without-gdbm --with-mcrypt=/usr/local/apps/libmcrypt --disable-fileinfo 报错:1, **configure: error: system libzip must be upgraded to version >=**0.11。 使用Yum最新版只到0.10,不足以达到要求。 一、先删除libzip yum remove libzip -y SSH执行以上命令,先删除libzip 和 libzip-devel 二、下载安装并手动编译 wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install 三、(可忽略)另外最新版本请参考官网:https://nih.at/libzip/ 1.5.0的libzip需要cmake wget https://libzip.org/download/libzip-1.5.0.tar.gz tar -zxvf libzip-* cd libzip* mkdir build && cd build && cmake .. && make && make install 报错2: error: off_t undefined; check your library configuration 根据报错信息分析 configure: error: off_t undefined; check your library configuration 定义的类型 off_t。 off_t 类型是在 头文件 unistd.h中定义的,在32位系统 编程成 long int ,64位系统则编译成 long long int ,这里题主的系统应该是 64位的吧,在进行编译的时候 是默认查64位的动态链接库,但是默认情况下 centos 的动态链接库配置文件/etc/ld.so.conf里并没有加入搜索路径,这个时候需要将 /usr/local/lib64 /usr/lib64 这些针对64位的库文件路径加进去。 采用下面的方法。 添加搜索路径到配置文件 echo '/usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64'>>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值