致命错误:调用未定义函数utf8_substr()Opencart

Sha*_*ikh 5 php opencart opencart2.x

我的网站在过去2到3个月内都工作正常,但现在显示500服务器错误消息。然后我看到error.log文件说

PHP致命错误:在第11行的public_html / catalog / model / tool / image.php中调用未定义的函数utf8_substr()

在给定位置的代码是:

$new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
Run Code Online (Sandbox Code Playgroud)

然后我认为可能是因为缓存,然后我清除了缓存,仍然收到相同的错误消息。我一直在寻找对谷歌的解决方案,我发现像一些解决方案Clearing cache,检查startup.phputf8.php缺失或没有,但文件是在正确的地方。它正在生产环境中,并且站点从过去两天开始已关闭。

请告诉我这个问题的解决方案。

我正在运行Opencart版本2.0.3.1

提前致谢

小智 1

请检查您是否已安装mbstringPHPiconv扩展。因为此功能仅在您安装其中之一时加载。这是您的案例的代码https://github.com/opencart/opencart/blob/master/upload/system/helper/utf8.php