Fixing phpMyAdmin 404 Not Found Error

Last update: 06-09-2024

Encountering a 404 Not Found error when trying to access phpMyAdmin can be frustrating. This usually happens if a web server was not selected during the installation process. Here’s how you can resolve this issue and get phpMyAdmin working on your localhost.

Solution 1: Include phpMyAdmin Configuration in Apache

One straightforward solution is to manually include the phpMyAdmin configuration in the Apache configuration file. Follow these steps:

  1. Open the Apache configuration file in a text editor with root privileges:
  2. sudo nano /etc/apache2/apache2.conf
  3. Add the following line at the end of the file:
  4. Include /etc/phpmyadmin/apache.conf
  5. Save the file and exit the text editor (Ctrl+X, then Y, then Enter).
  6. Restart Apache to apply the changes:
  7. sudo systemctl restart apache2
  8. Try accessing phpMyAdmin by navigating to http://localhost/phpmyadmin.

Solution 2: Reinstall phpMyAdmin with Apache Configuration

If the first solution doesn’t work, or if you prefer a fresh installation, you can follow these steps to reinstall phpMyAdmin and ensure the Apache web server is selected:

  1. Update your package list:
  2. sudo apt update
  3. Remove the current phpMyAdmin installation:
  4. sudo apt remove phpmyadmin
  5. Set the necessary configurations before reinstalling:
    echo "phpmyadmin phpmyadmin/dbconfig-install boolean false" | sudo debconf-set-selections
    echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | sudo debconf-set-selections
  7. Reinstall phpMyAdmin along with PHP:
  8. sudo apt install php phpmyadmin
  9. Restart Apache to apply the changes:
  10. sudo systemctl restart apache2
  11. Try accessing phpMyAdmin by navigating to http://localhost/phpmyadmin.

By following either of these solutions, you should be able to resolve the 404 Not Found error and access phpMyAdmin on your localhost.


Add a new comment: