Extension mysqli is missing, phpmyadmin doesn't work

Extension mysqli is missing, phpmyadmin doesn't work

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Extension mysqli is missing, phpmyadmin doesn't work

This error occurs because phpMyAdmin relies heavily on the MySQLi extension for database connectivity and feature rendering. When you run a phpinfo() script and see no mention of mysqli, or when the interface throws the specific "The mysqli extension is missing" error, it indicates a configuration mismatch between your PHP installation and the required libraries.

In your specific case involving Ubuntu 12.04, Apache2, PHP5, and MySQL, the root cause is likely that the PHP development package does not include the compiled extensions by default, or the php.ini file is pointing to an incorrect configuration directory. Simply uncommenting a line in a php.ini file found in /etc/php/5.x/apache2/etc/ will fail if that specific binary wasn't actually built against your MySQL server.

To resolve this, you must first ensure the php-mysql (or php5-mysql depending on your exact package version) and php-mysqli packages are installed. On Ubuntu 12.04, these were distinct packages. If you only have Apache2 and PHP5 installed via the standard repositories without explicitly requesting the MySQL extensions, they remain absent.

Run the following command to install the necessary extension modules:

sudo apt-get update
sudo apt-get install php5-mysql php5-mysqli

Once the packages are installed, you must locate the active configuration file that Apache is actually using. The path /etc/php5/apache2/php.ini is common for older Ubuntu versions, but it is crucial to verify which file is loaded. You can check this by looking at the Apache error log or by inspecting the php.ini directive itself:

grep -R "include_path" /etc/php5/apache2/
grep -R "^extension_dir" /etc/php5/apache2/php.ini

If the extension_dir points to a directory where .so files do not exist, you may need to add the extensions manually. Open your active php.ini file and ensure the following lines are uncommented (remove the leading semicolon):

extension=mysql.so
extension=mysqli.so

Note that in some PHP versions on Ubuntu 12.04, the package name was php5-mysql, which provided both mysql.so and mysqli.so. If you previously uncommented extension=mysql.so and it failed, verify that the file actually exists at the path specified in extension_dir. You can check this with:

ls -l /etc/php5/apache2/extensions/
# or wherever your extension_dir is configured

If the .so files are missing after installation, the package installation might have failed silently or the libraries weren't linked correctly. Reinstalling the package often resolves missing library dependencies:

sudo apt-get install --reinstall php5-mysql php5-mysqli

After making changes to php.ini, you must restart Apache for the configuration to take effect. Using a reload command is generally safer during development:

sudo /etc/init.d/apache2 restart

Verify that the extension is now loaded by creating a new file named info.php in your web root with just <?php phpinfo(); ?>, then accessing it via your browser. Look for the "mysqli" section in the output. If it appears, restart phpMyAdmin and the error should be gone.

A common pitfall during this process is modifying the wrong php.ini. On Ubuntu, there are often copies in /etc/php5/cli/ (for command line) and /etc/php5/apache2/ (for web). Modifying the CLI version will have zero effect on your web application. Always ensure you are editing the configuration associated with the apache2 module.

If you continue to face issues, consider upgrading your environment. Ubuntu 12.04 is End of Life and no longer receives security updates or package support. Modern PHP versions and MySQLi implementations handle connection pooling and prepared statements more robustly than legacy setups. For production environments today, leveraging managed hosting solutions like those offered by LaravelCompany can bypass many of these low-level configuration headaches, allowing you to focus on application logic rather than troubleshooting extension mismatches in outdated OS versions.

Our network