gpt4 book ai didi

php - 无法调用内置的 mb_internal_encoding 方法?

转载 作者:IT王子 更新时间:2023-10-29 01:09:25 25 4
gpt4 key购买 nike

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

[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 manual the mb_internal_encoding function应该是 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。

[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 已被禁用(暂时)。

我该如何解决这个问题?

最佳答案

mbstring 是一个“非默认”扩展,默认情况下不启用;见 this page手册:

Installation

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,因此您的修改会被考虑在内)


我不使用 CentOS,但您可能必须先安装扩展程序,使用类似这样的东西(例如,参见 this page,这似乎提供了解决方案):

yum install php-mbstring

(包名可能有点不同;所以,使用 yum 搜索来获取它:-))

关于php - 无法调用内置的 mb_internal_encoding 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1216274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com