Menu

#4720 (ok 4.4) No error message on Missing extension mbstring

4.3.7
fixed
Low
2015-04-01
2015-01-20
No

PHPMyAdmin on my Fedora does not start at all and gives '500 Internal Server Error' on my browser console, though no error or message of any sort is shown on screen.

This problem was caused by php-mbstring not being available, and resolved when I installed it, but shouldn't the system show some sort of error message about mb-string not being installed, so the user knows what is wrong.

Using php 5.6.4 with apache, phpMyAdmin version 4.3.7

Discussion

  • Marc Delisle

    Marc Delisle - 2015-01-20

    There is a detection for this, see
    https://github.com/phpmyadmin/phpmyadmin/blob/MAINT_4_3_7/index.php#L469

    Can you put this at line 470 to see what happens?
    error_log('at line 470');
    and look in Apache's error log?

     
  • Rohit Mulange

    Rohit Mulange - 2015-01-20

    Marc, the detection uses mbstring to render the message, while the error itself is about mbstring being unavailable.. hence the unexpected internal server error is cause. see line 177 in php-gettext/gettext.inc...

    (./libraries/php-gettext/gettext.inc _encode function) which uses mbstring
    library functions to change encoding of the message

    here is the sequence of functions called when mbstring is not found

    PMA_warnMissingExtension('mbstring', $fatal = true);
    PMA_fatalError($message); (in file core.lib.php)
    __('Error'); (in file gettext.inc)
    _gettext($msgid) (in file gettext.inc)
    _encode()

    _encode in turn uses mb_detect_encoding to detect the encoding, so when the error reporting for warnMissingExtension is called for missing mbstring, unexpected error is caused since mb_detect_encoding doesn't exist.

     
  • Rohit Mulange

    Rohit Mulange - 2015-01-20

    Execution never reaches line 470 stops at line 12 when libraries/common.inc.php is loaded.. showed you above the stacktrace when execution stops..

     
  • Madhura Jayaratne

    If showing the error message only in English without using gettext is acceptable, it would be the easiest way to resolve this.

     
    • Isaac Bennetch

      Isaac Bennetch - 2015-01-22

      I also think the English string without using gettext is the best option here.

       
  • Madhura Jayaratne

    On a second thought, since mbstring is core requirement for phpMyAdmin, do we need to warn about missing mbstring at all?

     
    • Marc Delisle

      Marc Delisle - 2015-01-22

      Yes because some users don't read the doc.

       
  • Marc Delisle

    Marc Delisle - 2015-01-22
    • assigned_to: Marc Delisle
     
  • Marc Delisle

    Marc Delisle - 2015-01-22
    • summary: phpMyAdmin exits without error message on Missing extension mbstring --> No error message on Missing extension mbstring
     
  • Marc Delisle

    Marc Delisle - 2015-01-22
    • summary: No error message on Missing extension mbstring --> (ok 4.4) No error message on Missing extension mbstring
    • status: open --> resolved
    • Group: 3.3.7 --> 4.3.7
    • Priority: 3 --> 1
     
  • Marc Delisle

    Marc Delisle - 2015-02-15
    • Priority: 1 --> Normal
     
  • Marc Delisle

    Marc Delisle - 2015-02-15
    • Priority: Normal --> Low
     
  • Marc Delisle

    Marc Delisle - 2015-04-01
    • Status: resolved --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.