zoukankan      html  css  js  c++  java
  • You don't have permission to access / on this server.

    今天在测试一个程序的时候,发现这个问题:

    Forbidden

    You don't have permission to access / on this server.

     IMG_0759.PNG

    开始的时候我是用http://localhost/test.php进行的测试,没有发现问题,后来要在内网测试一下就要用IP地址进行那个访问了,如:http://10.10.50.195/test.php,就出现了这个问题。

     

    修改一下php的配置文件httpd.conf。

     

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

    1. <Directory/>
    2.     AllowOverrideNone
    3.     Order deny,allow
    4.    Deny from all
    5.     Satisfy all
    6. </Directory>
     

    修改成

    1. <Directory/>
    2.     OptionsFollowSymLinks
    3.     AllowOverrideNone
    4.     Order deny,allow
    5. #    Deny from all
    6.    Allow from all
    7. #允许所有访问
    8.     Satisfy all
    9. </Directory>
     

     

    还有

     

    1. <Directory"D:/Wamp5/www">
    2.     #
    3.     # Possible values for the Options directive are "None", "All",
    4.     # or any combination of:
    5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    6.     #
    7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
    8.     # doesn't give it to you.
    9.     #
    10.     # The Options directive is both complicated and important.  Please see
    11.     # http://httpd.apache.org/docs/2.2/mod/core.html#options
    12.     # for more information.
    13.     #
    14.     OptionsIndexesFollowSymLinks
    15.     #
    16.     # AllowOverride controls what directives may be placed in .htaccess files.
    17.     # It can be "All", "None", or any combination of the keywords:
    18.     #   Options FileInfo AuthConfig Limit
    19.     #
    20.     AllowOverride all
    21.     #
    22.     # Controls who can get stuff from this server.
    23.     #
    24. #   onlineoffline tag - don't remove
    25.     OrderDeny,Allow
    26.     Deny from all
    27.     Allow from 127.0.0.1
    28. </Directory>
     

    修改成

     

    1. <Directory"D:/Wamp5/www">
    2.     #
    3.     # Possible values for the Options directive are "None", "All",
    4.     # or any combination of:
    5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    6.     #
    7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
    8.     # doesn't give it to you.
    9.     #
    10.     # The Options directive is both complicated and important.  Please see
    11.     # http://httpd.apache.org/docs/2.2/mod/core.html#options
    12.     # for more information.
    13.     #
    14.     OptionsIndexesFollowSymLinks
    15.     #
    16.     # AllowOverride controls what directives may be placed in .htaccess files.
    17.     # It can be "All", "None", or any combination of the keywords:
    18.     #   Options FileInfo AuthConfig Limit
    19.     #
    20.     AllowOverride all
    21.     #
    22.     # Controls who can get stuff from this server.
    23.     #
    24. #   onlineoffline tag - don't remove
    25.     OrderDeny,Allow
    26. #    Deny from all
    27. #  Allow from 127.0.0.1
    28.     Allow from all
    29. </Directory>
     

    然后保存,重启服务,再访问就解决了这个问题。

     

    修改后的截图:


     

    魔芋:用手机访问测试。

    成功!!

     

    **





  • 相关阅读:
    楼宇及工业自动化总线协议介绍
    PROFIBUS,PROFINET,Ethernet三者的区别
    转:OSAL多任务资源分配机制
    Zigbee系列 学习笔记二(工程文件分析)
    Zigbee系列 学习笔记一(协议栈)
    STC12C5A60S2单片机 PWM调试
    单片机 IO口配置模式介绍
    串口通信校验方式
    STC12C5A60S2单片机 串口调试
    本地Nexus 3.3.2 启动
  • 原文地址:https://www.cnblogs.com/moyuling/p/5192562.html
Copyright © 2011-2022 走看看