我有以下声明:
$img->setTitle(mb_check_encoding($item['title'], 'UTF-8') ? $item['title'] : utf8_encode($item['title']));
Run Code Online (Sandbox Code Playgroud)
这适用于我的 PHP 5.4.17 本地设置和我的具有 PHP 5.3.xx 的共享主机
但是当我将此应用程序部署到 Heroku(具有 PHP 5.3.10)时,它在日志中出现以下错误:
2012-12-26T09:55:28+00:00 app[web.1]: [Wed Dec 26 09:55:27 2012] [error] [client 10.119.79.71] PHP Fatal error: Call to undefined function mb_check_encoding() in /app/www/includes/utils.php on line 44, referer: https://imagemash.herokuapp.com/
具体根据php.net文档,mb_check_encoding 被支持PHP 5> = 5.1.3。
我究竟做错了什么?还是我的应用程序以某种方式使用了旧版本的 PHP?似乎也不需要设置任何 php.ini 值来启用此功能。
感谢 AJ。
$ yum install php-mbstring
Run Code Online (Sandbox Code Playgroud)
也许重新加载apache:
$ systemctl reload apache2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8188 次 |
| 最近记录: |