PHP: Call to undefined function mb_strlen() - on custom compiled PHP with mbstring enabled

和自甴很熟 提交于 2019-12-03 13:24:13

For PHP 4.3.3 or before, To enable that feature, you will have to supply either one of the following options to the LANG parameter of --enable-mbstring=LANG ; --enable-mbstring=cn for Simplified Chinese support, --enable-mbstring=tw for Traditional Chinese support, --enable-mbstring=kr for Korean support, --enable-mbstring=ru for Russian support, and --enable-mbstring=ja for Japanese support (default). To enable all supported encoding, use --enable-mbstring=all

try

  • configure again with --enable-mbstring only

  • grep mb_strlen $PATH_TO_YOUR_PHP_BINARY to see is it exist

On my Windows system with PHP and Apache, I had to modify the PHP.INI file so that it includes the following line:

extension=php_mbstring.dll

(inside the main [PHP] section) and restart Apache. After that, the call to mb_strlen did succeed.

Put this phpinfo() in a some php file for the output. And look for MbString seperate box there, if it is not present, then it is not installed properly.

Ivijan-Stefan Stipić

Simple solution.

Instead mb_strlen() only use strlen().

To me, it worked a few times.

I had the same problem, this is an issue with php version.

first run

sudo apt install php-mbstring

to install mbstring to the latest installed version of php

then run:

 sudo apt-get dist-upgrade

and restart apache with

 sudo /etc/init.d/apache2 restart

Good luck

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!