Ubuntu – Xampp: I can’t access phpMyAdmin from localhost

localhostphpmyadminUbuntuxampp

I was trying to set up Xampp for home development. It's correctly installed and I can access xampp pages like demos, security, status… even using the phytin-gui to start and stop the server.

But when it comes to access phpMyAdmin using 'http://localhost/phpmyadmin' I get the next error:

Access forbidden!

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".

I checked my httpd-xampp.conf and seems to be correct. I tried to change the deny All for the Allow all but not worked.

My host files points localhost to 127.0.0.1, which is what is expected to access all xampp files.

I'm runing XAMPP 1.8.1 in ubuntu 12.04 machine

Someone that had that same issue? I lost near 2 hours googling but all what I found is that this error happens when trying to access the server from other network or machine. But for me the case is that i work directly on the server so its supposed that i could access phpMyAdmin as default.

My httpd-xampp.conf

#
# 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>

Best Answer

Go to /opt/lampp/etc/extra directory in case you have installed XAMPP under /opt, and edit httpd-xampp.conf to add Require all granted as shown below:

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

You may have to restart your LAMPP sever by running /opt/lampp/lampp restart.

Related Topic