Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

phpMyAdmin says the mbstring extension is missing

ErrorThe mbstring extension is missing. Please check your PHP configuration.

Short answer

phpMyAdmin found no mbstring module in the PHP that serves it. Install the php-mbstring package on Ubuntu, or enable extension=mbstring in php.ini on Windows, then restart the web server. If it still shows, the web server loads a different php.ini than the one you edited.

  • Applies to phpMyAdmin 5.2, PHP 8.3, Ubuntu 24.04, Apache 2.4
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask PHP on the command line whether it has mbstring and which ini files it reads. The CLI and the web server can differ, so keep this result in mind for the third cause.

    php -m | grep -i mbstring
    php --ini
  2. 2Match what you see, then jump to its fix

    1. 1php -m prints nothing for mbstringThe mbstring package is not installed (Ubuntu)Fix
    2. 2phpinfo() has no mbstring section; php.ini has ;extension=mbstring or no such lineThe extension line is off in php.ini (Windows)Fix
    3. 3php -m shows mbstring but the phpMyAdmin page still complainsThe web server reads a different php.ini than the one you editedFix

What does the error look like?

  • The mbstring extension is missing. Please check your PHP configuration.

Cause 1 of 3

The mbstring package is not installed (Ubuntu)

1Check

Ubuntu ships the module as a separate package. php-mbstring pulls in the one for your PHP version (php8.3-mbstring on 24.04), and the phpmyadmin package itself depends on php-mbstring.

dpkg -l | grep -i mbstring

2Fix

Install it and restart Apache so the running web server loads it.

sudo apt install php-mbstring
sudo systemctl restart apache2

3Verify

Reload phpMyAdmin; the red message is gone. php -m now lists mbstring.

php -m | grep -i mbstring

Confirmed by packages.ubuntu.com

Did this fix it?

Cause 2 of 3

The extension line is off in php.ini (Windows)

1Check

On Windows the module is a DLL in the ext folder, switched on in php.ini. Since PHP 7.2 the extension name can be used instead of the file name, and extension_dir must point at the ext folder.

php --ini
dir C:\php\ext\php_mbstring.dll

2Fix

Remove the semicolon from the line (or add it), check extension_dir, save, and restart the web server.

extension_dir = "C:\php\ext"
extension=mbstring

3Verify

The phpinfo() page now shows an mbstring section.

php -m | findstr mbstring

Confirmed by php.net

Did this fix it?

Cause 3 of 3

The web server reads a different php.ini than the one you edited

1Check

PHP chooses its ini file per SAPI. Apache's module reads it once, when the server starts, so edits need a restart. A phpinfo() page opened in the browser shows the web server's Loaded Configuration File, which can differ from the terminal's.

<?php
// temporary file in the web root, delete it afterwards
phpinfo();

2Fix

Edit the file that the browser's phpinfo() names, then restart the web server.

sudo systemctl restart apache2

3Verify

Reload the phpinfo() page and look for an mbstring section, then reload phpMyAdmin.

curl -s http://localhost/phpmyadmin/ | head -n 5

Confirmed by php.net

Did this fix it?

How do I stop it coming back?

  • Install phpMyAdmin from your distribution's package so its PHP dependencies come with it.
  • Delete any phpinfo() test file as soon as you are done.
  • After a PHP version upgrade, check that the new version has the same extensions as the old one.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

WordPress says PHP is missing the MySQL extension

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

WordPress lists mysqli among the PHP extensions it requires, because it uses it to talk to MySQL or MariaDB.

3 causes, each with a fix

Back end

CodeIgniter 4 cannot write its cache files

CodeIgniter\Cache\Exceptions\CacheException: Cache unable to write to /var/www/app/writable/cache/

CodeIgniter 4's file cache needs a cache directory that the web server can really write to.

2 causes, each with a fix

Back end

CodeIgniter 3 loads the model but the property is undefined

The model name you are loading is the name of a resource that is already being used: user

CodeIgniter 3 expects a model file named like its class, with the first letter capitalised, for example User_model.php holding class User_model.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.