PHP "Call to undefined function mb_detect_encoding" Error

Posted: 2014-11-20 18:01:16

This error is always related to PHP being unable to load the php_mbstring extension, because of some issue with the “php_mbstring.dll” file, or the environment…

Fatal error: Call to undefined function mb_detect_encoding() in Wamp\phpMyAdmin\libraries\php-gettext\ on line 177

It usually happens when you try to access phpMyAdmin.

Update PATH and Reboot OS

After installing WAMP, or using a new version of PHP, make sure to reboot/restart the system. This will:

Unblock php_mbstring.dll

Go into PHP’s \ext folder, right-click on file “php_mbstring.dll”, select Properties, and at the bottom make sure the file not listed as “Blocked”. If it is, click “unblock”.

Restart Apache.

Test Dependencies

Test for the presence of all the DLLs the php_mbstring.dll extension depends on…

Open the command-line, change to PHP’s directory, and run PHP’s deplister:

cd Components\Php
deplister ext\php_mbstring.dll

* This will only work on some newer versions of PHP that have “deplister”.

If you see a message about MSVCR110.dll (or some similar named DLL) missing / not-found, your system is missing this run-time:
Visual C++ Redistributable for Visual Studio 2012 Update 4

You’ll need the 32 bit version: vcredist_x86.exe

This run-time is included on most current and updated OSs, but some non-updated OSs only have the 2008 version.


Check php.ini

Check php.ini to make sure extension “php_mbstring.dll” is being included/loaded…

Locate, and make sure this extension line is un-commented (no ‘;’ in front) –

It’s loaded by default under WAMP, unless the PHP version’s php.ini was modified.

Restart Apache.

Check for older DLLs

It is possible that some PHP DLLs, from other PHP or WAMP installations, exist on your system, which should be removed.

Search your PC for files: php5ts.dll, php5.dll, php_mbstring.dll

The found location will most like be:

In the location you find any of the above files, you might also have a bunch of other php*.dll files that need to be deleted.

* Don’t delete anything within WAMP’s folder:


Check Log Files

If nothing else helps, check the Log files again –

A. Apache’s general error log – Logs\Apache\

B. PHP’s general error log – Logs\Php\errorlog.txt (if exists)

C. And if this is specific to a website, the website’s error logs –

In the case of http://localhost/phpmyadmin or , that “” would be “serverhost”.