ylnor
ylnor

Reputation: 4879

Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding()

I received the following error trying to acces http://localhost/phpmyadmin/ :

Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding() in C:\Apache24\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc:177 Stack trace: #0 C:\Apache24\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc(282): _encode('The %s extensio...') #1 C:\Apache24\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc(289): _gettext('The %s extensio...') #2 C:\Apache24\htdocs\phpmyadmin\libraries\core.lib.php(306): __('The %s extensio...') #3 C:\Apache24\htdocs\phpmyadmin\libraries\core.lib.php(961): PMA_warnMissingExtension('mbstring', true) #4 C:\Apache24\htdocs\phpmyadmin\libraries\common.inc.php(102): PMA_checkExtensions() #5 C:\Apache24\htdocs\phpmyadmin\index.php(13): require_once('C:\\Apache24\\htd...') #6 {main} thrown in C:\Apache24\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177

After reviewing similar topics here, I did the following:

  1. Checked (using info.php) the path of my php.ini file : Loaded Configuration File C:\PHP\php.ini
  2. Modified and uncommented the following lines in php.ini:
    • extension_dir = "c:\PHP\ext" (also tried "c:/PHP/ext")
    • extension=php_gd2.dll
    • extension=php_mbstring.dll
    • extension=php_exif.dll
    • extension=php_mysqli.dll
  3. Tried both 32bits and 64bits dlls
  4. Made sure that all the dll were in the c:/PHP/ext file and righ-clicked>properties>unblock each of them.
  5. Restarted httpd.exe many time, rebooted the server too.

Here is the content of my httpd.conf Apache config file :

Here is the content of my httpd.conf :

LoadModule php7_module C:/PHP/php7apache2_4.dll

<IfModule php7_module>
    DirectoryIndex index.html index.php
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/PHP"
</IfModule>

I keep receiving the same message with no clue how to solve it.

I am running windows 10, with Apache 2.4-64bits, PHP7-64bits and MysqlServer5.7. Apache is running fine, PHP too (no worries accessing info.php)

Thanks.

Upvotes: 4

Views: 2507

Answers (1)

Oleks
Oleks

Reputation: 1633

I've heard that Apache2.4 has some problems with PHPINIDir. So try to add PHPIniDir "C:\PHP" in http.conf

Upvotes: 1

Related Questions