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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了You don't have permission to access / on this server.相关的知识,希望对你有一定的参考价值。

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

Forbidden

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

 技术分享

开始的时候我是用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>
 

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

 

修改后的截图:

技术分享

 

技术分享

魔芋:用手机访问测试。

成功!!

 

**





以上是关于You don't have permission to access / on this server.的主要内容,如果未能解决你的问题,请参考以下文章

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

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

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

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

Forbidden You don't have permission to access XXX on this server

the file couldn't be opened because you don't have permission to view it