博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[php排错] Forbidden You don't have permission to access / on this server.
阅读量:4873 次
发布时间:2019-06-11

本文共 1979 字,大约阅读时间需要 6 分钟。

刚开始接触PHP,在搭建完环境后发现输入127.0.0.1可以访问界面,但是输入http://localhost却提醒无权访问,在百度之后发现是php中的httpd.conf的作用

在wamp中搜索发现有两个httpd.conf,于是把两个都改了,然后重启服务发现可以访问了,方法如下:

<Directory />

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

修改成

<Directory />

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all

</Directory>

其次修改:

Directory "D:/Wamp5/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
    # 
    # 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 "D:/Wamp5/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
    # 
    # 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

    Allow from all

</Directory>

转载于:https://www.cnblogs.com/fantasy01/p/4150163.html

你可能感兴趣的文章
理解粒子滤波(particle filter)
查看>>
1-6-04:数组逆序重放
查看>>
PHP之文件目录基础操作方法
查看>>
POJ 2251 Dungeon Master(3D迷宫 bfs)
查看>>
问题 B: 习题6-5 数组元素逆置
查看>>
Xenomai 3 migration
查看>>
windows下apache httpd2.4.26集群完整搭建例子:下载、启动、tomcat集群例子
查看>>
Android应用资源---绘制资源类型(Drawable)(四)
查看>>
bzoj 2155 Xor
查看>>
git 设定全局ignore
查看>>
Rails5 layout 和 template
查看>>
Codeforces Round #460 Div. 2 C.D
查看>>
CodeForces 1110H. Modest Substrings
查看>>
同构伪代码彻底理解using 指令
查看>>
落没的十句经典
查看>>
LIST对象排序问题
查看>>
树总结之并查集趣解
查看>>
Don't repeat yourself
查看>>
wpa_supplicant移植与使用(转)
查看>>
iOS开源项目:AFNetworking----写得非常好
查看>>