Apache 启动时显示“/etc/httpd/conf/httpd.conf 语法错误:无效命令‘remove’”

Apache 启动时显示“/etc/httpd/conf/httpd.conf 语法错误:无效命令‘remove’”

在我更改了php.ini最大文件上传大小和最大帖子大小后,重新启动 Apache 会显示标题中的错误。为什么?如何解决?

# vi /etc/php.ini
# service httpd restart


# service httpd start
Starting httpd: Syntax error on line 304 of /etc/httpd/conf/httpd.conf:
Invalid command 'remove', perhaps misspelled or defined by a module not included in the server configuration

第 304 行如下:

<Directory />
    Options Includes Indexes FollowSymLinks MultiViews
    remove word Indexes
    Options Includes FollowSymlinks MultiViews
    AllowOverride None
</Directory>

答案1

删除该代码片段中的第 3 行和第 4 行。您的配置应如下所示

<Directory />
    Options Includes Indexes FollowSymLinks MultiViews
    AllowOverride None
</Directory>

相关内容