可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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:
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.
回答2:
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/
回答3:
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. :)
回答4:
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
回答5:
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>
回答6:
after putting "Allow from all", you need to restart your xampp to apply the setting. thanks
回答7:
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.
回答8:
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
回答9:
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
...