【问题标题】:Why does mb_convert_encoding fail? [closed]为什么 mb_convert_encoding 失败? [关闭]
【发布时间】:2015-09-01 06:46:51
【问题描述】:

为什么

<?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()

【问题讨论】:

  • 检查您的错误日志!它将包含比“500”更详细的错误描述。
  • 开启错误报告/记录
  • 你的php页面在哪里???
  • http 500 是内部重定向失败,与mb_convert_encoding函数无关
  • 为什么要投票关闭? @Andrew 好的,然后忽略 http 500。问题是为什么 mb_convert_encoding 失败。

标签: php mb-convert-encoding


【解决方案1】:

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

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

【讨论】:

  • 谢谢。我一直认为这是核心的一部分!
  • 嗯,它是一个扩展...它需要在编译PHP时显式启用。
猜你喜欢
  • 2014-05-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多