【发布时间】:2018-11-24 05:45:46
【问题描述】:
使用安装了 XAMPP 的 windows server 2012(Apache/2.4.33 (Win32) OpenSSL/1.0.2o PHP/5.6.36)检查了几乎 stackoverflow 的答案,但得到了同样的错误。
xampp 不会从 htdocs 访问除 xampp 仪表板以外的任何项目。
错误:
httpd-vhost.conf:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mysite"
ServerName local.yourdomain.com
<Directory "C:/xampp/htdocs/mysite">
Require all granted
</Directory>
</VirtualHost>
主机:
127.0.0.1 localhost
127.0.0.1 local.yourdomain.com
httpd.conf:
DocumentRoot "C:/xampp/htdocs/mysite"
<Directory "C:/xampp/htdocs/mysite">
#
# 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>
【问题讨论】:
-
我的网站文件夹是空的?
-
您是否检查过您的目录权限以确保 apache(至少)具有对 htdocs 目录的读取权限?如果 Apache 作为服务安装(即它将以 windows 启动),那么它将以系统用户身份运行。
-
@Metalik - 未选中,但默认进入 xampp 仪表板。它仅在 htdocs 中,所以 htdocs 可以访问吗?
-
请告诉我如何检查 htdocs 的 apache 读取访问权限。
-
尝试更改虚拟主机上的文档根目录valuebound.com/resources/blog/…
标签: php xampp windows-server-2012