12

I can access localhost fine on Xampp with phpmyadmin on ubuntu. I can see the contents of /htdocs which I completely cleared and wrote my own for. I want to access phpmyadmin, but cannot.

When loading phomyadmin, I am greeted by a 403 Error and a note advising me to configure the setting in the file httpd-xampp.conf. I looked in /opt/lampp/etc/extra/httpd-xampp.conf, but have no idea what to configure.

Two areas within the file seem useful in this scenario:

<Directoy "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Deny From all
</Directory>

and

#
# New XAMPP security concept
#

<LocationMatch "^/(?: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 \
    fe00::/10 169.254.0.0/16

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

In both segments I tried changing "Deny from all" to "Allow from all" and restarted Xampp with the command sudo /opt/lampp/lampp restart. I received the same error page as before. I tried other solutions found online, but none have worked.

What do I have to configure to access phpmyadmin?

JoshDM
  • 4,939
  • 7
  • 43
  • 72
Andrew Fairbairn
  • 167
  • 1
  • 1
  • 10

3 Answers3

20

The solution can be found here. Summary follows:

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

Add the line Require all granted to the bottom of the <Directory "/opt/lampp/phpmyadmin"> block as follows:

<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory>
JoshDM
  • 4,939
  • 7
  • 43
  • 72
Sumit Munot
  • 3,748
  • 1
  • 32
  • 51
  • 1
    That worked for me (I write this because this answer is actually not accepted -> to show everybody that this is working). – Eich Feb 18 '13 at 22:31
  • 1
    Someone also pointed out that the new line (Require...) should replace the previous 2 lines (Order... and Allow...) – dmolony Apr 30 '13 at 05:34
  • 1
    works on windows too^^ (obviously change path to relevant path) – treyBake Dec 20 '17 at 14:44
3

I solved this by creating a new virtual host for phpmyadmin

For windows systems:

Append the following to C:/xampp/apache/conf/httpd.conf:

NameVirtualHost phpmyadmin.local

<VirtualHost phpmyadmin.local>
  ServerName phpmyadmin.local
  DocumentRoot "C:/xampp/htdocs/phpmyadmin"
  <Directory "C:/xampp/htdocs/phpmyadmin">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

Change the DocumentRoot/Directory to the path where you have installed your version of phpmyadmin.

Open the C:\Windows\System32\drivers\etc\hosts file in a text editor and add the following line:

127.0.0.1     phpmyadmin.local

then save the hosts file and restart xampp.

Andy
  • 2,892
  • 2
  • 26
  • 33
  • Thank you, this was the only solution that worked for me. However, phpmyadmin was at ```C:/xampp/phpMyAdmin``` in my case. – Robin Jun 27 '13 at 16:25
0

Try this

New XAMPP security concept

Search in httpd-xampp.conf

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

Replace with or remove phpmyadmin

<LocationMatch "^/(?i:(?:xampp|security|licenses|webalizer|server-status|server-info))">
        Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Farid Vatani
  • 626
  • 1
  • 7
  • 24
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130