熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PHP編程 >> 正文

PHP錯誤:Forbidden You donot have permission to acce

2022-06-13   來源: PHP編程 

  今天在測試一個php程序的時候發現這個問題:

  Forbidden

  You dont have permission to access / on this server
 

  開始的時候我是用進行的測試沒有發現問題後來要在內網測試一下就要用IP地址進行那個訪問了就出現了這個問題

  後來咨詢了一下朋友(php高手)說修改一下php的配置文件

  在原有的位置文件中找到配置節

  <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order denyallow
    Deny from all
    Satisfy all
</Directory>

  修改成

  <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order denyallow
#    Deny from all
    Allow from all

  #允許所有訪問
    Satisfy all
</Directory>

  
還有

  <Directory "D:/Wamp/www">

  #
    # Possible values for the Options directive are "None" "All"
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* "Options All"
    # doesnt give it to you
    #
    # The Options directive is both complicated and important  Please see
    # http://#options
    # for more information
    #
    Options Indexes FollowSymLinks

  #
    # AllowOverride controls what directives may be placed in htaccess files
    # It can be "All" "None" or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

  #
    # Controls who can get stuff from this server
    #
#   onlineoffline tag dont remove
    Order DenyAllow
    Deny from all
    Allow from

  </Directory>

  修改成

  <Directory "D:/Wamp/www">

  #
    # Possible values for the Options directive are "None" "All"
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* "Options All"
    # doesnt give it to you
    #
    # The Options directive is both complicated and important  Please see
    # http://#options
    # for more information
    #
    Options Indexes FollowSymLinks

  #
    # AllowOverride controls what directives may be placed in htaccess files
    # It can be "All" "None" or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

  #
    # Controls who can get stuff from this server
    #
#   onlineoffline tag dont remove
    Order DenyAllow
#    Deny from all

  #  Allow from
    Allow from all

  </Directory>

  然後保存重啟服務在訪問就解決了這個問題


From:http://tw.wingwit.com/Article/program/PHP/201311/21175.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.