xampp 安装后,默认的 DocumentRoot 是安装目录下的 htdocs 目录,编程时有很多不便
废话不多说,下面就给你献上方法,本人操作了之后更改成功的
第一步:打开xampp,找到Manage Servers,点击
第二步:点击Apache Web Server ,点击其对应的Configure
第三步:点击Open Conf File
第四步:搜索“htdocs“,跳到如下图并对应更改
当然这么多代码不会让你敲拉,复制下面的就可以了
DocumentRoot "E:/project/php"//更改为你想要的路径
<Directory "E:/project/php">
#
# 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 Includes ExecCGI
#
# 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.
#
Require all granted
</Directory>
别忘了最后一步哦
更改以上设置后,必须重启 xmapp才能使设置生效