如何检查 apache 中启用的 mod_headers 和 mod_expires 模块
我想检查我的服务器中是否启用了 mod_headers 和 mod_expires 模块
有没有一种方法可以使用某些 php 函数列出 apache 启用/禁用模块,就像我们使用 phpinfo(); 函数列出 php 信息一样?
I want to check whether mod_headers and mod_expires modules enabled or not in my server
Is there a way available to list apache enabled/disabled modules using some php function just like we list php information with phpinfo(); function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
以上所有答案都是错误的。请改用:
apachectl -t -D DUMP_MODULES
或
apachectl -M
All the above answers are wrong. Use instead:
apachectl -t -D DUMP_MODULES
or
apachectl -M
在 Debian 上:
大多数 GNU/Linux 发行版:
Ubuntu:
在 Mac OSX 上:
在 Win 7(64 位)上: 在
除 Windows 之外的所有操作系统中从终端窗口尝试这些命令,这将使用 CMD。
On Debian:
Most GNU/Linux distros:
Ubuntu:
On Mac OSX:
On Win 7 (64-bit):
Try these commands from a terminal window in all but Windows, which will use CMD instead.
某些版本的 PHP/Apache 在“已加载模块”下的 phpinfo() 中显示所有已加载模块。
Speeve的答案显示在模块中编译(我的系统上是x6):
您还需要查看启用的模块(对我来说是x36):
要获取禁用模块的列表,请运行此命令,然后划掉所有启用的模块:
Some versions of PHP/Apache show all loaded modules in phpinfo() under "Loaded Modules".
Speeve's answer shows compiled in modules (x6 on my system):
You'll also need to see your enabled modules (x36 for me):
To get the list of disabled modules, run this command then cross off all the enabled modules:
在 Ubuntu 上,您可以在此处查看启用的模块列表,
On Ubuntu you can see the list of enabled modules here,