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

简介: 原文:PHP错误:Forbidden You don't have permission to access / on this server.今天老大让在xp下搭建一个FTP服务器,一波三折,最后终于在老大的帮助下搞定了。
原文: 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。

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

<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>

 

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

目录
相关文章
|
7月前
|
PHP Apache
PHP $_SERVER
PHP $_SERVER
21 0
|
9月前
|
PHP
php开发实战分析(4):php调用封装函数包含文件路径自适应不同目录的解决方案($_SERVER[‘DOCUMENT_ROOT‘]与__DIR__魔术常量)
php开发实战分析(4):php调用封装函数包含文件路径自适应不同目录的解决方案($_SERVER[‘DOCUMENT_ROOT‘]与__DIR__魔术常量)
132 0
|
9月前
|
关系型数据库 MySQL PHP
Window Server studyPro部署php环境mysql数据库配置遇见的问题
Window Server studyPro部署php环境mysql数据库配置遇见的问题
59 1
|
移动开发 PHP
Visual Studio Code中的PHP提示错误:End of line character is invalid
Visual Studio Code中的PHP提示错误:End of line character is invalid
88 0
|
XML JSON PHP
PHP解析json、xml错误
php内置函数json_decode() 可以解析json字符串 但是有的时候看起来正确的json,解析却一直返回null。 你知道吗,json是可能解析失败的,此时PHP不会产生提示。 我们需要手动通过json_last_error()函数获取
184 0
|
PHP
PHP错误与异常
PHP语言中错误与异常
74 0
PHP错误与异常
|
PHP
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
98 0
【laravel报错】You don‘t have permission to access /laravel/public/index.php on this server.
|
PHP
PHP $SERVER详解
PHP $SERVER详解
92 0
PHP $SERVER详解