18
votes

When I try to access an phpMyAdmin of xampp in another pc using ip address I get this error:

Access forbidden!

New XAMPP security concept:

Access to the requested object is only available from the local network.

This setting can be configured in the file "httpd-xampp.conf".

I was searching for the solution and found a bunch of suggestions like modifying httpd-xampp.conf file.

1) Option was to modify <LocationMatch> block like this:

<LocationMatch "^/(?i(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Allow from all
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

The problem is that my httpd-xampp.conf file does not contain such a block, but if I try to add it to the end of the file I still get the same error.

2) Option was to modify <Directory "C:/xampp/phpMyAdmin"> as following:

<Directory "C:/xampp/phpMyAdmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Or

<Directory "C:/xampp/phpMyAdmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Or

<Directory "C:/xampp/phpMyAdmin">
    AllowOverride AuthConfig Limit
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

This didn't solve the problem either. Still getting same error.

P.S. I am restarting Apache after each change!

Could someone see what I could be missing?

4
Dont use both Apache 2.2 and Apache 2.4 syntax in the same config - RiggsFolly
I use one at a time, still error - Ignas Damunskis
Not in option 2 you dont. Use either Order allow,deny Allow from all (Apache 2.2 syntax) OR Require all granted (Apache 2.4 syntax) - RiggsFolly
Tried both separatelly still same error. Updated question. - Ignas Damunskis

4 Answers

26
votes

I just fixed it ! Please go to :

<Directory "C:/xampp/phpMyAdmin">
    AllowOverride AuthConfig
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

and change all the contents as below:

<Directory "C:/xampp/phpMyAdmin">
     AllowOverride AuthConfig Limit
     Order allow,deny
     Require all granted
     Allow from all
</Directory>
23
votes

If you using Mac, Go to Xampp Panel > Volumes > Mount, and here you are

enter image description here

then,

  1. open httpd-xampp.conf

  2. change:

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

to:

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

5) Restart Services

8
votes

Nothing worked for me but following thing was awesome:

1) Open

/opt/lampp/etc/extra/httpd-xampp.conf

2) Find <Directory "/opt/lampp/phpmyadmin">

3) Now just add Require all granted before

4) So the code will look like this

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

5) Now finally Restart XAMPP

0
votes

I found a solution

just comment this line "Require local"

# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    #Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>