Home Solved Solved: WAMP Forbidden Error 403

Solved: WAMP PHPMyAdmin Error 403 Forbidden

How to fix WAMP PHPMyAdmin Forbidden Error 403. How to solve the 403 Error Forbidden and access denied when accessing phpmyadmin on WAMP server.

By a TechBitBytes Contributor, March 17, 2023
5 MIN READ |

You can access localhost from remotely from another device (PC or mobile) in the same LAN as the PC with WAMP by simply using the WAMP-PC-IPv4-ADDRESS/. This process gives you access to the web pages remotely as served by the Apache server. However, when accessing the phpmyadmin database remotely you should use the WAMP-PC-IPv4-ADDRESS/phpmyadmin/. However, you are likely to be met with the Error 403: Forbidden access.

Forbidden

You don't have permission to access /phpmyadmin/ on this server


Furthermore, you can have the same error when accessing localhost/phpmyadmin/ if the PHPMyAdmin access settings are not properly configured.

What does the PHPMyAdmin Forbidden Error Occur?

A 403 Forbidden error occurs when the user does not have access to the directory or files on the server.

If you successfully install WAMP on a Windows PC, chances are you will not get this error when accessing localhost/phpmyadmin/. However, if you access the same remotely from another device on the same LAN, you will get this error. PHPMyAdmin by default has a security measure that limits remote access and allows access only to the local machine (PC where WAMP is installed).

You can allow the WAMP Apache server to be accessed remotely by other machines in the same LAN by modifying the Windows Firewall inbound rules. However, you must allow PHPMyAdmin resources to be accessed by other devices as well to successfully clear the 403 forbidden error.

How to Fix Forbidden Error PHPMyAdmin

Before fixing the PHPMyAdmin forbidden error, ensure you can access the web server. If on the WAMP PC, go to localhost/. If on another remote device (on the same LAN as WAMP PC), use the WAMP PC's IPv4 address as WAMP-PC-IPv4-ADDRESS/ for instance 192.168.1.102/ You should see the WAMP default page. If you see another 403 forbidden error, clear that one first using the steps provided in the solution below before proceeding.

Let's solve the PHPMyAdmin 403 forbidden error.

First, access the phpmyadmin.conf file on WAMP. This file is located in C:/wamp/alias/ if on a 32-bit Windows PC and C:/wamp64/alias/ if on a 64-bit Windows PC.

To edit the phpmyadmin.conf file:

On Windows 7, right-click it, and go to Open With on the pop-up box. Click on Choose default program, search for Notepad, you can check or uncheck the Always use the selected program to open this kind of file, and click the OK button.

On Windows 10, right-click the phpmyadmin.conf file, and click on Open With on the pop-up box. On the dialog box, click on Notepad. You can check or uncheck the Always use this app to open .conf files, and click the OK button.

In the phpmyadmin.conf, look for the default line:

<Directory "c:/wamp/apps/phpmyadmin5.2.0">
   Options +Indexes +FollowSymLinks +MultiViews
   AllowOverride all
   Require local
</Directory>

If you cannot access PHPMyAdmin on the local machine through localhost/phpmyadmin/ ensure that the line Require local exists and is not commented (doesn't have a # before it).

If you are accessing remotely from another device (PC or mobile) on the same LAN you have two options.

Option 1: Allow Only Specific IPs (Recommended)

First, get the IPv4 address of the remote device; that which you are accessing PHPMyAdmin on (not the one with WAMP server).

On the phpmyadmin.conf file, add the following line below the Require local line. Require ip PC-IPv4-ADDRESS.

If the IPv4 is 192.168.0.102, the changes made would be:

<Directory "c:/wamp/apps/phpmyadmin5.2.0">
   Options +Indexes +FollowSymLinks +MultiViews
   AllowOverride all
   Require local
   Require ip 192.168.0.102
</Directory>

Restart your WAMP server.

Whereas this method is considered secure, you would have to ensure that the IPs are static on the LAN. Otherwise, you would have to update this line once the target machine changes its IP.

Option 2: Allow All IPs (Not Recommended)

You can change the line Require local to Require all granted. The changes made would be:

<Directory "c:/wamp/apps/phpmyadmin5.2.0">
   Options +Indexes +FollowSymLinks +MultiViews
   AllowOverride all
   Require all granted
</Directory>

Restart your WAMP server.

However, this option is a security risk as any device on the local network (LAN) can access the PHPMyAdmin resources on your server.

 

  This article is written to the best of the author's knowledge. TechBitBytes(TBB) ensures that all articles are constantly updated with the latest information.