【问题标题】:Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration无效的命令“要求”,可能拼写错误或由未包含在服务器配置中的模块定义
【发布时间】:2013-09-21 13:35:32
【问题描述】:

我刚刚在我的开发机器上安装了最新版本的 WAMP,但我无法让它工作。收到这个奇怪的错误。

C:\wamp\bin\apache\Apache2.4.4\bin>httpd.exe
AH00526: Syntax error on line 224 of C:/wamp/bin/apache/Apache2.4.4/conf/httpd.conf:
Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration

C:\wamp\bin\apache\Apache2.4.4\bin>httpd.exe -v
Server version: Apache/2.4.4 (Win64)
Server built:   Feb 22 2013 22:08:37

这是第 224 行的配置:

222: <Directory />
223:    AllowOverride none
224:    Require all granted
225: </Directory>

知道我做错了什么吗?

【问题讨论】:

    标签: apache configuration wampserver


    【解决方案1】:

    Require 指令由mod_authz_core 提供。如果该模块尚未编译到您的 Apache 二进制文件中,您将需要在配置文件中添加一个条目以手动加载它。你可以用httpd.exe -l查看编译了哪些模块。

    如果模块没有编译进去,用类似下面的配置行加载它:

    LoadModule authz_core_module    "<apache install dir>/modules/standard/mod_authz_core.so"
    

    当然,您需要调整系统的路径,在 Windows 机器上,库很可能是 dll 而不是 so 文件。

    【讨论】:

    • Order 也需要 mod_access_compat。要解决这两个问题,请运行:a2enmod authz_host a2enmod access_compat 如果在 linux 上出现这些问题并且应该没问题。
    • 感谢@dannio,您解决了我的问题。但是我可以将您的命令编辑为a2enmod authz_host access_compat
    猜你喜欢
    • 2018-02-12
    • 2015-05-14
    • 2017-11-04
    • 2012-04-26
    • 2013-08-24
    • 1970-01-01
    • 2017-11-16
    • 2022-01-14
    相关资源
    最近更新 更多