-4

为什么

<?php 

echo "HELLO WORLD 1"; // shows
error_reporting(E_ALL);
echo "HELLO WORLD 2"; // shows
print_r(mb_list_encodings()); // does not show
echo "HELLO WORLD 3"; // does not show
$result = mb_convert_encoding("apple", 'UTF-8');
echo "HELLO WORLD 4"; // does not show;
echo $result; // does not show;

// no error what so ever displayed.

?>

失败?什么会使此功能失败?

我有一个 PHP 网页,它运行代码并在这一行停止,并返回 HTTP 500 错误。

但我不知道为什么会失败。关于在哪里检查的任何建议?

更新: 错误日志显示

PHP Fatal error:  Call to undefined function mb_convert_encoding()
4

1 回答 1

3

PHP 致命错误:调用未定义函数 mb_convert_encoding()

这意味着mb_convert_encoding没有安装,因为您的 PHP 版本上没有安装 MB 扩展。如何安装它取决于你如何安装 PHP。您的操作系统很可能有一个包管理器(apt-get 等),可以让您快速安装它。否则,请参阅手册

于 2015-09-01T07:16:24.310 回答