本文介绍了无法调用内置的mb_internal_encoding方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在CentOS 5.3 VMware'box'上安装indefero,但遇到了问题.在安装的早期,我得到了一个错误,可以缩小到以下范围:

I'm trying to install indefero on a CentOS 5.3 VMware 'box' and I ran into a problem.Quite early in the installation I get an error that I've been able to narrow down to this:

[root@code /var/www/html]# cat x.php
 <?php
     mb_internal_encoding("UTF-8");
 ?>
[root@code /var/www/html]# php x.php
PHP Fatal error:  Call to undefined function mb_internal_encoding() in 
/var/www/html/x.php on line 2

当通过Apache通过http调用此脚本时,我得到了相同的错误.现在,根据 PHP手册,mb_internal_encoding函数应该是内置的在PHP 5中.

I get the same error when calling this script via http through Apache.Now according to the PHP manual the mb_internal_encoding function should be a builtin in PHP 5.

我有CentOS 5.3 i386(Linux代码2.6.18-53.1.21.el5#1 SMP Tue May 20 09:34:18 EDT 2008 i686 i686 i386 GNU/Linux),并且我已经安装了PHP 5.2.9.

I have CentOS 5.3 i386 (Linux code 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:34:18 EDT 2008 i686 i686 i386 GNU/Linux) and I've installed PHP 5.2.9.

[root@code /var/www/html]# php -v
PHP 5.2.9 (cli) (built: Jul  8 2009 06:03:36)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

我再次检查:selinux已被禁用(暂时).

I double checked: selinux has been disabled (for now).

我该如何解决?

推荐答案

mbstring是一个非默认"扩展名,默认情况下未启用;参见手册的本页:

mbstring is a "non-default" extension, that is not enabled by default ; see this page of the manual :

mbstring是非默认扩展名. 这意味着它没有被启用 默认.您必须明确启用 具有configure选项的模块. 有关详细信息,请参见安装"部分.

mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option. See the Install section for details

因此,您可能必须启用该扩展,修改php.ini文件(并重新启动Apache,以便将您的修改考虑在内)

So, you might have to enable that extension, modifying the php.ini file (and restarting Apache, so your modification is taken into account)


我不使用CentOS,但您可能必须先使用这样的扩展名安装扩展程序(请参阅此页面,例如,这似乎提供了解决方案):


I don't use CentOS, but you may have to install the extension first, using something like this (see this page, for instance, which seems to give a solution) :

yum install php-mbstring

(程序包名称可能有所不同;因此,请使用yum search来获取它:-))

这篇关于无法调用内置的mb_internal_encoding方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 04:53