Fork me on GitHub
魔芋铃

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>
 

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

 

修改后的截图:


 

魔芋:用手机访问测试。

成功!!

 

**





posted @ 2016-02-16 14:02  魔芋铃  阅读(426)  评论(0编辑  收藏  举报