Fatal error: Call to undefined function mb_detect_encoding() Fatal error: Call to undefined function mb_detect_encoding() php php

Fatal error: Call to undefined function mb_detect_encoding()


There's a much easier way than recompiling PHP. Just yum install the required mbstring library:

Example: How to install PHP mbstring on CentOS 6.2

yum --enablerepo=remi install php-mbstring

Oh, and don't forget to restart apache afterward.


Mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option.

In case your php version is 7.0:

sudo apt-get install php7.0-mbstringsudo service apache2 restart

In case your php version is 5.6:

sudo apt-get install php5.6-mbstringsudo service apache2 restart