有没有简单的方法可以仅使用 PHP 来检测 modsecurity 是否已安装并启用?理想情况下,无需执行任何 exec() 终端类型命令。
有些人建议使用 apache_get_modules() 但这个特定的网络主机不允许它显示。其他用户也提到了这一点:http://www.devcomments.com/apache_get_modules-solution-to130703.htm http://www.devcomments.com/apache_get_modules-solution-to130703.htm
Try the apache_get_modulesfunction http://php.net/apache_get_modules获取已加载模块的数组。如果该模块已加载但未列出,您可能想尝试phpinfo http://php.net/phpinfo with phpinfo(INFO_MODULES)
反而:
ob_start();
phpinfo(INFO_MODULES);
$contents = ob_get_clean();
$moduleAvailable = strpos($contents, 'mod_security') !== false;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)