PHP错误:Forbidden You don't have permission to access / on this server

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

Forbidden

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

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

后来咨询了一下朋友(php高手),说修改一下php的配置文件httpd.conf。

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

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

修改成

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

#允许所有访问
    Satisfy 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
    # 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 "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
    # 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
    Allow from all

</Directory>

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

时间: 2024-11-02 20:42:05

PHP错误:Forbidden You don't have permission to access / on this server的相关文章

PHP错误:Forbidden You don&amp;#39;t have permission to access / on this server.

原文:PHP错误:Forbidden You don't have permission to access / on this server. 今天老大让在xp下搭建一个FTP服务器,一波三折,最后终于在老大的帮助下搞定了... 其中通过ip访问的时候 提示 Forbidden You don't have permission to access / on this server. 找到一个解决方法,特此记录   php的配置文件httpd.conf. 在原有的位置文件中找到配置节 <Dir

Forbidden You don&amp;#39;t have permission to access / on this server.

原文:Forbidden You don't have permission to access / on this server.Forbidden You don't have permission to access / on this server. 当出现此问题的时候,记得修改httpd.conf. 在原有的位置文件中找到配置节 <Directory />     Options FollowSymLinks     AllowOverride None     Order deny

关于You don t have permission to access / on this server提示总结

仔细检查了一遍配置文件httpd.conf,找到这么一段:  代码如下 复制代码 <Directory />     Options FollowSymLinks     AllowOverride None     Order deny,allow     deny from all     Satisfy all </Directory> 然后试着把deny from all中的deny改成了allow,保存后重起了apache,然后再一测试我的网页 apache 解决Apac

You don&#039;t have permission to access / on this server提示 求解决办法~

提示You don't have permission to access / on this server..Apache定义了默认对网站根的访问权限. # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdire

Apache出现You dont have permission to access / on this server解决方法

由于对环境不了解在配置好环境之后Apache出现You don't have permission to access / on this server. 提示  代码如下 复制代码 <Directory />     Options FollowSymLinks     AllowOverride None     Order deny,allow     Deny from all </Directory> 解决办法 把 Deny from all 中的 Deny 改成了All

WampServer设置apache伪静态出现404 not found及You don&#039;t have permission to access / on this server解决方法分析[原创]_服务器其它

本文实例讲述了WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法.分享给大家供大家参考.具体如下: 出现404 not found 时: 确保LoadModule rewrite_module modules/mod_rewrite.so开启 然后 复制代码 代码如下: <Directory />     Options FollowSymLinks    

apache You don&#039;t have permission to access /test.php on this server解决方法_Linux

键字: Apache   403  Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数据库服务器:oracle 8i Apache服务器是目前应用最多的web服务器,据统计在世界上的服务器中有超过一半采用Apache服务器.关于它的好处,您可以自己到http://www.apache.org/上去看. 今天我们的服务器出了一点儿问题:任何访问都会返回一个403的错误: 复制代码 代码如

apache 提示You don&#039;t have permission to access /test.php on this server.怎样解决

原文:apache 提示You don't have permission to access /test.php on this server.怎样解决 关键字: Apache   403  Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数据库服务器:oracle 8i     Apache服务器是目前应用最多的web服务器,据统计在世界上的服务器中有超过一半采用Apache服务器

You don’t have permission to access /index.php on._Linux

今天在测试 PHP集成环境 Apache服务器时,一切正常,在转换虚拟目录时,突然出现错误提示"You don't have permission to access /index.php on."无论如何都不能正常浏览,再切换回原目录时,显示正常,只要切换虚拟目录,问题依旧. 其实这里是由于 httpd-conf 里面的配置问题,打开httpd-conf:逐行检查.在大约快一半的地方有以下这段代码: 复制代码 代码如下: <Directory /> Options Fol