CakeFest 2017 NYC, the Official CakePHP Conference


mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option. See the Install section for details.

The following configure options are related to the mbstring module.

  • --enable-mbstring : Enable mbstring functions. This option is required to use mbstring functions.

    libmbfl is necesarry for mbstring. libmbfl is bundled with mbstring. If libmbfl is already installed on the system, --with-libmbfl[=DIR] can be specified to use the installed library.

    As of PHP 4.3.0, mbstring extension provides enhanced support for Simplified Chinese, Traditional Chinese, Korean, and Russian in addition to Japanese.

    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 .


    As of PHP 4.3.4, all supported encoding by libmbfl is enabled with --enable-mbstring .

  • --enable-mbstr-enc-trans : Enable HTTP input character encoding conversion using mbstring conversion engine. If this feature is enabled, HTTP input character encoding may be converted to mbstring.internal_encoding automatically.


    As of PHP 4.3.0, the option --enable-mbstr-enc-trans was eliminated and replaced with the runtime setting mbstring.encoding_translation. HTTP input character encoding conversion is enabled when this is set to On (the default is Off).

  • --disable-mbregex : Disable regular expression functions with multibyte character support.

add a note add a note

User Contributed Notes 5 notes

kurdtpage at gmail dot com
5 months ago
For Linux Mint using PHP 7:
sudo apt-get install php7.0-mbstring

and don't forget to run:
sudo service apache2 restart
kacz at kaczmarowski dot com
8 years ago
Fedora 9 -- yum install php-mbstring then httpd -k restart to freshen the environment.

[EDIT BY danbrown AT php DOT net: This is true for all Red Hat Linux-based distributions using RPM and the `yum` package manager; this includes RHEL, Fedora, CentOS, Mandriva, and Intrinsic Linux, among others.]
1 year ago
mbstring is part of the libapache2-mod-php5 package in Debian. See:
tom at ritter dot vg
8 years ago
To compile with the mbstring option in gentoo, use the 'unicode' USE flag.
jmckenna at gatewaygeomatics dot com
7 years ago
The mb_split() function requires PHP to be compiled with --enable-mbregex (as of PHP 5.3.0).

To Top