45

I just installed xampp 1.8.0 for linux and when I opened phpmyadmin I got 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 tried this post but with no luck. please help. I am opening it from my own PC not from any other network.

1

11 Answers 11

58

If you see below error message, when try into phpyAdmin:

New XAMPP security concept:
Access to the requested directory is only available from the local network.
This setting can be configured in the file "httpd-xampp.conf".

You can do next (for XAMPP, deployed on the UNIX-system): You can try change configuration for <Directory "/opt/lampp/phpmyadmin">

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

and change security settings to

#LoadModule perl_module        modules/mod_perl.so

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

First - comment pl module, second - change config for node Directory. After it, you should restart httpd daemon

# /opt/lampp/xampp restart

Now you can access http://[server_ip]/phpmyadmin/

4
  • I've update as your guide but it still doesn't work, Could you give me a look? imgur.com/a3SOdNb
    – Luke
    Aug 30, 2018 at 12:55
  • Why are you telling people to comment out the Perl module? I don't see how that's relevant. Dec 20, 2018 at 6:26
  • i just copied and replaced this with this <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Order allow,deny Allow from all Require all granted ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory> Jun 30, 2020 at 14:55
  • This is the right answer for XAMPP 7.4.7 the most voted answer didn't solve my problem
    – Sophie cai
    Aug 16, 2020 at 3:38
57

open your http.conf file

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

Comment "Deny from all" in the following section,

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Order deny,allow
       #Deny from all
        Allow from ::1 127.0.0.0/8 \
                fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
                fe80::/10 169.254.0.0/16

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

Edit:
Try to add "Allow from all" before "ErrorDocument" line. Hope it helps.

5
  • 3
    @Sekar I'm afraid! Won't it allow other people from my ISP to handle XAMPP contents? Feb 2, 2013 at 6:49
  • If this still doesn't work, change the file permission will do the trick.
    – Fanglin
    Dec 2, 2013 at 15:44
  • @SantoshKumar yes it will. I'm trying to deny access to the Xampp folder as well. Jan 7, 2014 at 15:44
  • 1
    I think what you need to add is Require all granted instead of Require local.
    – KareemJ
    Apr 21, 2019 at 19:58
  • 1
    "Require local" is what is causing this issue. Aug 24, 2020 at 19:41
38

Nothing worked for me but following thing was awesome:

1) Open

httpd-xampp.conf

which is at

/opt/lampp/etc/extra/

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 the xampp with this command /opt/lampp/lampp restart

That's it and you are Done!

It also work with xampp. :)

1
  • 6
    The "Require all granted" was what made it work for me.
    – ryatkins
    Oct 31, 2018 at 14:43
28

Adding to Sekar answer

Don't forget to restart your XAMPP Server

Update the accepted answer :

now you need to comment Require local

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        #Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

0
18

on osx log into your terminal and execute

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

and replace

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

with this

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

and then restart apache and mysql

or use this command

 /opt/lampp/xampp restart
0
6

Hey, use these section of code.

Path for xampp is: apache\conf\extra\httpd-xampp.conf

 <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Order deny,allow
        Allow from all
        #Allow from ::1 127.0.0.0/8 \
             #      fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
               #    fe80::/10 169.254.0.0/16

        ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
    </LocationMatch>
0
6

The solution above are right but the challenge has been locating the particular file.

visit for mac https://www.youtube.com/watch?v=OVGCXYZ-BoI

visit for windows https://www.youtube.com/watch?v=MvYyEPaNNhE

INSTRUCTION (If not interested in video)

MAC

Steps

  1. Start your xampp application
  2. Start services

enter image description here

  1. Click on the Volumes menu
  2. Click mount
  3. Click Explore

enter image description here

N.B It opens the opt/lampp/ window enter image description here

  1. Open the following directory to locate file lamp/etc/extra/httpd-xampp-conf
  2. Open the file with any IDE of your choice e.g Visual Studio or PhpStorm or Text-Editor
  3. Locate below code and replace the Require local with Require all granted.

Alias /phpmyadmin "D:/server/phpMyAdmin/" <Directory "D:/server/phpMyAdmin"> AllowOverride AuthConfig Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

  1. Ensure you restart all services

  2. Reload your page and Whuala.....It works

1
  • 1
    Thanks for the screenshots and easy-to-follow steps. Sep 10, 2021 at 20:50
3

I newer version of xampp you may use another method first open your httpd-xampp.conf file and find the string "phpmyadmin" using ctrl+F command (Windows). and then replace this code

Alias /phpmyadmin "D:/server/phpMyAdmin/"
<Directory "D:/server/phpMyAdmin">
    AllowOverride AuthConfig
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

with this

Alias /phpmyadmin "D:/server/phpMyAdmin/"
<Directory "D:/server/phpMyAdmin">
    AllowOverride AuthConfig
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Don't Forget to Restart your Xampp.

2

after putting "Allow from all", you need to restart your xampp to apply the setting. thanks

0

On Xampp 5.6.3 Windows Path C:\xampp\apache\conf\extra\httpd-xampp.conf comment in this: #Require local

New XAMPP security concept ... #Require local ...

0

Not need to change all config in file /opt/lampp/etc/extra/httpd-xampp.conf. The only thing you need to change is the Require local It's kinda obvious what Require local means so just change to Require all granted Require all granted

Solution

from Require local to Require all granted

Not the answer you're looking for? Browse other questions tagged or ask your own question.