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:
- Open the Apache configuration file in a text editor with root privileges:
- Add the following line at the end of the file:
- Save the file and exit the text editor (Ctrl+X, then Y, then Enter).
- Restart Apache to apply the changes:
- Try accessing phpMyAdmin by navigating to http://localhost/phpmyadmin.
sudo nano /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf
sudo systemctl restart apache2
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:
- Update your package list:
- Remove the current phpMyAdmin installation:
- Set the necessary configurations before reinstalling:
- Reinstall phpMyAdmin along with PHP:
- Restart Apache to apply the changes:
- Try accessing phpMyAdmin by navigating to http://localhost/phpmyadmin.
sudo apt update
sudo apt remove phpmyadmin
echo "phpmyadmin phpmyadmin/dbconfig-install boolean false" | sudo debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | sudo debconf-set-selections
sudo apt install php phpmyadmin
sudo systemctl restart apache2
By following either of these solutions, you should be able to resolve the 404 Not Found error and access phpMyAdmin on your localhost.