wamp 自定义网站根目录失败,求教?

win10系统

wamp3.0.6

apache 2.4.23

修改httpd.conf为:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
HostnameLookups Off

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot D:/Demo
<Directory "D:/Demo">

    #
    # 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.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require local
</Directory>

斜体部分修改后,无法访问test.php文件

<?php

echo "成功";

?>

慕粉4282406
浏览 1949回答 3
3回答

我是新手_请多指教

不自定义根目录问题也不大,直接就把项目放在默认是wamp/www下就好了

西兰花伟大炮

你是从demo文件夹去访问的吗?
打开App,查看更多内容
随时随地看视频慕课网APP