phpMyAdmin - Error | The mbstring extension is missing. Please check your PHP configuration in Ubuntu 14.04 LTS
When you upgrade a legacy system like Ubuntu 14.04 LTS, unexpected dependency breaks are common. A specific error message regarding the mbstring extension often points to a misunderstanding of how modern package managers handle PHP modules compared to manual installation methods. The user scenario describes an environment where phpMyAdmin 4.5.5.1 and PHP 7.0.4-5 were manually extracted to /var/www/html, yet the application refuses to load after a system upgrade.
The core issue lies in the method used to enable extensions. The provided configuration snippet attempts to use .dll files:
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysqli.dll
This approach is fundamentally incompatible with the standard PHP distribution found on Ubuntu. Unlike Windows, Linux distributions (including Debian-based systems like Ubuntu) do not use DLL extensions by default for their core PHP binaries. The php.ini file expects extension names without the .dll suffix. Adding .dll to the configuration line will result in PHP ignoring that directive entirely or throwing a parse error depending on the exact syntax, which explains why the mbstring extension remains effectively disabled even after Apache is restarted.
To resolve this, you must edit the active PHP configuration file. On Ubuntu 14.04 with PHP 7, the primary configuration file is typically located at /etc/php/7.0/cli/php.ini for CLI usage and /etc/php/7.0/apache2/php.ini for web server integration. Open the Apache configuration file using sudo:
sudo nano /etc/php/7.0/apache2/php.ini
Search for lines containing mbstring. You will likely find commented-out entries or missing directives entirely. Uncomment and ensure the line reads exactly:
extension=mbstring
Do not include .so or .dll extensions here. If the mbstring extension is not listed at all, you need to install it via the package manager before uncommenting the directive:
sudo apt-get update
sudo apt-get install php7.0-mbstring
After modifying the configuration and installing the missing package, restart Apache to apply the changes without stopping other services unnecessarily:
sudo systemctl restart apache2
There is another significant architectural detail in your setup that contributes to instability. You mentioned downloading phpMyAdmin from the official site and moving it to /var/www/html. This manual installation bypasses the package manager's ability to track dependencies and handle library updates cleanly. When you ran sudo apt-get dist-upgrade, the system likely updated core PHP libraries or security headers that conflict with a manually installed, unmanaged version of phpMyAdmin.
The recommended best practice for managing web applications on Ubuntu is to use apt packages rather than manual extraction. This ensures that when you upgrade the OS or PHP version, all related extensions and dependencies are synchronized correctly. If you must stick with the manual installation path, ensure that your manually installed binaries match the exact architecture and version of the system PHP installed via apt.
Additionally, verify that the Apache configuration is actually pointing to the correct php.ini file. Check the error logs at /var/log/apache2/error.log for specific warnings about missing modules or syntax errors in the included files. The absence of mbstring in phpinfo() confirms that the directive is either missing or malformed, but once corrected via the package manager and proper configuration syntax, the application should function as expected without needing to edit .dll references.