[Solved] PhpMyAdmin not working on localhost – Phpmyadmin

Photo of author
Written By M Ibrahim
phpmyadmin xampp

Quick Fix: Utilize localhost:80/phpmyadmin to access phpMyAdmin initially. Once the browser identifies the correct URL, subsequent visits can be made using localhost/phpmyadmin.

The Problem:

A user has installed XAMPP on an external hard drive and is running Windows 8. They have also installed phpMyAdmin version 4.1.7 and copied the config.inc.php file from their old version of phpMyAdmin to the new version. However, when they try to access phpMyAdmin through localhost/phpMyAdmin, they receive a 404 error message stating that the requested URL was not found. Upon checking the XAMPP localhost welcome page, they find that the security link for phpMyAdmin indicates that the config.inc.php file could not be found. Despite verifying that the config.inc.php file exists in the local phpMyAdmin folder, the user is unable to log into phpMyAdmin.

Can you assist in resolving this issue and provide a solution to enable successful access to phpMyAdmin through localhost?

The Solutions:

Solution 1: Using Localhost and Port Number

To resolve the issue, simply load localhost:80/phpmyadmin in your browser. This will enable the browser to recognize the correct URL for phpMyAdmin. After doing this, you should be able to access phpMyAdmin using the traditional localhost/phpmyadmin URL.

Solution 2: Use ‘localhost/phpmyadmin’ (lowercase)

PHPMyAdmin has inconsistent directory names across its versions. If you’re encountering an “Object not found” error, check if you’re using the correct directory name. Try using ‘localhost/phpmyadmin’ (lowercase) instead of ‘localhost/phpMyAdmin’.

Solution 3: Find the correct PhpMyAdmin directory name

Confirm the URL by checking the name of the root folder. Navigate to your PhpMyAdmin installation directory and ensure that the root folder is named correctly. The directory name may vary depending on the version and distribution of PhpMyAdmin.

Solution 4: Fix the config.inc.php file

If the “Could not find the ‘config.inc.php'” error persists, follow these steps to correct it:
1. Locate the config.inc.php file in the PhpMyAdmin root directory.
2. Rename the existing config.inc.php file to something else as a backup.
3. Copy the config.sample.inc.php file (found in the same directory) and rename it to config.inc.php.
4. Check if PhpMyAdmin is working now.
5. If it is, compare the new config.inc.php file with your old backup file. Copy and replace specific parts that you want to carry over from the old config.

Solution 5: Use the XAMPP security wizard

If you’re having issues with security settings in your old config file, consider using the security wizard built into XAMPP. This wizard can help you configure security settings for your specific version of PhpMyAdmin. Access the XAMPP security wizard by visiting ‘localhost/security/xamppsecurity.php’.

Solution 3: Changing the XAMPP Service Status and Port Numbers

Steps:

  1. Open the Control Panel.
  2. Locate and open the “Services” option.
  3. Find the “XAMPP Services” and “Apache Services” in the services list.
  4. If the checkboxes next to these services are empty, click on the checkboxes to mark them and enable the services.
  5. Change the port numbers of both XAMPP and Apache to 80.
  6. Click “Apply” and “OK” to save the changes.

After following these steps, you should be able to access phpMyAdmin by typing “localhost/phpMyAdmin” in your browser’s address bar.

Solution 4: Copy the phpmyadmin configuration file to the Apache configuration directory.

If you are using Ubuntu, you can follow these steps to resolve the issue:

  • Open the terminal and run the following command to copy the phpmyadmin configuration file to the Apache configuration directory:
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
  • Now, enable the phpmyadmin configuration file using the command:
sudo a2enconf phpmyadmin
  • Finally, restart the Apache service to apply the changes:
sudo service apache2 restart

After following these steps, you should be able to access phpMyAdmin at http://localhost/phpMyAdmin.

Solution 5: Bypassing Proxy Server

This solution is applicable if you are using a proxy server on your network that may be interfering with the connection to PhpMyAdmin on localhost.

  1. Open the Control Panel from the Start menu or search bar.
  2. Locate and click on “Network and Internet”.
  3. Click on “Network and Sharing Center”.
  4. On the bottom left corner of the window, find and click on “Internet Options”.
  5. Under the “Connections” tab, locate and click on “LAN settings”.
  6. Tick the checkbox next to “Bypass proxy server for local addresses”.
  7. Click “OK” to save the changes.

After following these steps, try accessing PhpMyAdmin again by typing “localhost/phpMyAdmin” in your browser’s address bar. This should resolve the issue and allow you to access PhpMyAdmin on localhost without encountering the “Object not found” error.