wamp 403 禁止访问

时间:2023-01-05 17:59:33


​http://blog.sina.com.cn/s/blog_4a60ba9c01014nch.html​

我的电脑使用的是wamp5,把php项目发布到www文件夹下后,使用http://localhost可以打开网站,然而采用我的局域网中的IP地址访问(如:http://192.168.0.108/),提示403错误,无权访问该页面。在网上找了好多资料,最后终于找到了,解决方案如下:我的wamp装在c盘下,需要修改一下C:\wamp\Apache2\conf下的httpd.conf文件中的一些权限设置找到下面Directory开头的下面两段:

<Directory "c:/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"    # doesn't give it to you.    #    # The Options directive is both complicated and important.  Please see    # http://httpd.apache.org/docs/2.2/mod/core.html#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 - don't remove

 

    Order Deny,Allow

 

    Deny from all

 

    Allow from 127.0.0.1
</Directory>

 

<Directory "c:/wamp/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Deny from all
</Directory>

 

   解决方法:1.将Allow from 127.0.0.1改为Allow from all 

                 2.将Deny from all改为Allow from a