All pastes #2046720 Raw Edit

Detect apache mod with PHP

public php v1 · immutable
#2046720 ·published 2011-04-15 08:47 UTC
rendered paste body
/** * return true if the module $name is activated in apache * * @param string $name module name * @return boolean * @author Samdha <contact@samdha.net> **/function detect_apache_mod($name) {	$save = ob_get_clean();	ob_start();	phpinfo();	$phpinfo = ob_get_clean();	if ($save !== false) {		ob_start();		echo $save;	}	return (strpos($phpinfo, $name) !== false);}if (detect_apache_mod('mod_evasive')) sleep(1);