3

I just upgraded from Xubuntu 19.10 to 20.04. This moved me from php 7.3 to php 7.4.3 and phpmyadmin 4.9.5+dsfg1-2.

Everything was working prior to the upgrade. Now, I can successfully access a test php web page and I can display the PHP_info.php page. However, when I try to access phpmyadmin, it throws a fatal error recorded in the apache2 error log file. Here it is, expanded for readability:

[Tue Sep 15 20:15:09.030096 2020] [php7:error] [pid 2092141] [client ###.###.###.###:53310]
PHP Fatal error:  Uncaught Error:
Call to undefined function PhpMyAdmin\\mb_strpos() in /usr/share/phpmyadmin/libraries/classes/Url.php:253
Stack trace:
#0 /usr/share/phpmyadmin/libraries/classes/Url.php(206): PhpMyAdmin\\Url::getArgSeparator()
#1 /usr/share/phpmyadmin/libraries/classes/Url.php(169): PhpMyAdmin\\Url::getCommonRaw()
#2 /usr/share/phpmyadmin/libraries/classes/Core.php(749): PhpMyAdmin\\Url::getCommon()
#3 /usr/share/phpmyadmin/libraries/classes/Core.php(330): PhpMyAdmin\\Core::linkURL()
#4 /usr/share/phpmyadmin/libraries/classes/Core.php(353): PhpMyAdmin\\Core::getPHPDocLink()
#5 /usr/share/phpmyadmin/libraries/classes/Core.php(973): PhpMyAdmin\\Core::warnMissingExtension()
#6 /usr/share/phpmyadmin/libraries/common.inc.php(106): PhpMyAdmin\\Core::checkExtensions()
#7 /usr/share/phpmyadmin/index.php(27): require_once('/usr/share/phpm...')
#8 {main}
  thrown in /usr/share/phpmyadmin/libraries/classes/Url.php on line 253, referer: http://<server>/html/admin.html

How is it that the function mb_strpos() is not defined?

Any suggestions on how to address this?

3 Answers 3

6

mb_strpos is not a default function in core PHP, it's contained in the mbstring extension. You can easily install it with sudo apt install php-mbstring

3
  • Thanks, that did it once I restarted apache2. It's interesting that this package was automatically installed and updated in the past for php 7.0 and 7.2, but not for 7.4. I appreciate the quick response. Sep 16, 2020 at 23:50
  • I was thinking about that part and the only idea I came up with was maybe you installed it previously by specifying the php7.2-mbstring package rather than the php-mbstring virtual package. If so, it's possible Ubuntu didn't recognize php7.2-mbstring -> php7.4-mbstring was an upgrade path (they're separate packages, not just a different version) but hopefully you're set now by using the virtual package. Sep 17, 2020 at 4:27
  • 2
    I already have php-mbstring and still get the error.
    – Black
    Jun 9, 2022 at 8:59
2

You need to find out which PHP your server is using by placing a info.php with this code:

<?php phpinfo(); ?>

Then you need to download php-mbstring for this version, e.g. if you have PHP 8.0.15 then you need to install it like this:

sudo apt-get install php8.0-mbstring

Then restart the apache2 service:

sudo service apache2 restart
0

I had the same problem and it was because I was using php7.0-mbstring. Fixed it by installing php7.2-mbstring.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .