我正在Xampp上运行Apache 2.2并突然开始在启动命令提示符中给出错误说:
AH00526: Syntax error on line 248 of C:/xampp/apache/conf/httpd.conf:
Invalid command "<DirectoryIndex", perhaps misspelled or defined by a module not included in the server configuration
..所以我在Xampp配置中检查Apache httpd配置设置中的服务器配置并更改代码:
DocumentRoot "C:/xampp/htdocs"
<DirectoryIndex> index.php index.html
# 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
</DirectoryIndex>
我尝试关闭&lt;&gt;它只是一直在说同样的错误。 这是Directory索引的define命令的问题吗?如果我需要安装一些额外的依赖项,那么命令提示有什么问题?
答案 0 :(得分:0)
对于Apache 2.2
<Directory /path/to/your/directory/ >
DirectoryIndex index.html
</Directory>
<Directory /foo>
DirectoryIndex index.html
DirectoryIndex index.php
</Directory>
<Directory /foo>
DirectoryIndex index.html index.php
</Directory>
重新启动 XAMPP Web服务器