2013-03-14 78 views
0

當我嘗試打開localhost/phpmyadmin/我得到以下錯誤:錯誤403,因爲我嘗試打開phpmyadmin。我該怎麼做才能糾正它?

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

If you think this is a server error, please contact the webmaster. 

Error 403 

這是爲什麼?我打開了httpd-xampp.conf文件,但我不知道該怎麼做。

這是完整的httpd-xampp.conf文件:

<IfDefine PHP4> 
LoadModule php4_module  modules/libphp4.so 
</IfDefine> 
<IfDefine PHP5> 
LoadModule php5_module  modules/libphp5.so 
</IfDefine> 
# Disabled in XAMPP 1.8.0-beta2 because of current incompatibilities with Apache 2.4 
# LoadModule perl_module  modules/mod_perl.so 


Alias /phpmyadmin "/opt/lampp/phpmyadmin" 
Alias /phpsqliteadmin "/opt/lampp/phpsqliteadmin" 

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

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

# since LAMPP 1.0RC1 
AddType application/x-httpd-php .php .php3 .php4 

XBitHack on 

# since 0.9.8 we've mod_perl 
<IfModule mod_perl.c> 
    AddHandler perl-script .pl 
    PerlHandler ModPerl::PerlRunPrefork 
    PerlOptions +ParseHeaders 
    PerlSendHeader On 
</IfModule> 

# demo for mod_perl responsehandler 
#PerlModule Apache::CurrentTime 
#<Location /time> 
#  SetHandler modperl 
#  PerlResponseHandler Apache::CurrentTime 
#</Location> 

# AcceptMutex sysvsem is default but on some systems we need this 
# thanks to jeff ort for this hint 
#AcceptMutex flock 
#LockFile /opt/lampp/logs/accept.lock 

# this makes mod_dbd happy - oswald, 02aug06 
# mod_dbd doesn't work in Apache 2.2.3: getting always heaps of "glibc detected *** corrupted double-linked list" on shutdown - oswald, 10sep06 
#DBDriver sqlite3 

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

嘗試的解決方案:http://stackoverflow.com/questions/11630412/phpmyadmin-xampp-error – 2013-03-14 12:21:58

回答

3

看起來這部分是你的問題,你的IP地址/ IP範圍不能在允許的IP地址

# New XAMPP security concept 
# 
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> 
    Order deny,allow 
    Deny from all 
    # The line below this comment! 
    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> 

如果名單這是一個開發環境,那麼以下就足夠了:

# New XAMPP security concept 
# 
<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> 

否則,只需添加您的IP範圍,以允許部分:)

編輯:我應該把答案從評論,讓別人能看到它更容易:

「好吧,嘗試將要求所有批准在該行的所有行允許 之後的行上。「從這裏

+0

當我刪除你提到的部分,我甚至不能訪問'localhost'頁面! – saplingPro 2013-03-14 11:19:46

+0

你能告訴我你準確的放?當你嘗試訪問它會發生什麼? – Seer 2013-03-14 11:33:11

+0

' \t訂單拒絕,允許 \t所有 \t允許的ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var ' – saplingPro 2013-03-14 11:39:49

相關問題