启用mbstring时未定义函数

启用mbstring时未定义函数

本文介绍了mb_convert_encoding,启用mbstring时未定义函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行PHP 5.3.8和Apache2/MySQL的服务器(Ubuntu 11.10 x64).我目前正在一个需要进行某些特定字符编码的项目中,但是我发现多字节(mb_ *函数)都无法正常工作.

I have a server (Ubuntu 11.10 x64) running PHP 5.3.8 with Apache2 / MySQL. I'm currently working on a project where I'm required to do some specific character encoding, but I found out that none of the multibyte (mb_* functions) are working.

但是,当我查看phpinfo()时,发现启用了多字节支持.

However, when I look in phpinfo(), I see that multibyte support is enabled.

我已经尝试了诸如apt-get install php5-mbstring,php-mbstring,php-multibyte等之类的工作,但是似乎都无法正常工作.

I've tried things like apt-get install php5-mbstring, php-mbstring, php-multibyte, etc. etc. but none seem to work.

有人可以为此指出正确的方向吗?预先感谢!

Can anyone point me in the right direction for this? Thanks in advance!

./configure --enable-mbstring

./configure --enable-mbstring

这很奇怪,phpinfo()已经显示它已启用.我不知道为什么它以前不起作用:/

The weird this is, phpinfo() already showed that it was enabled. I don't know why it didn't work before :/

推荐答案

许多较新的Linux服务器默认未安装PHP Multibyte模块.一个简单的解决方案通常是安装php-mbstring.

A lot of newer Linux servers do not have PHP Multibyte modules installed by default. A simple solution is often to install php-mbstring.

在Red Hat版本(CentOS,Fedora等)上,您可以使用yum install php-mbstring.

On Red Hat flavors (CentOS, Fedora, etc.) you can use yum install php-mbstring.

确保随后重新启动Apache服务器.在RH风格上使用服务httpd重新启动.

Make sure you restart your Apache server afterwards. Use service httpd restart on RH flavors.

这篇关于mb_convert_encoding,启用mbstring时未定义函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 21:39