diff --git a/apache/apache-lib.pl b/apache/apache-lib.pl index 840b9e2b9..10fc3adfe 100755 --- a/apache/apache-lib.pl +++ b/apache/apache-lib.pl @@ -1753,13 +1753,16 @@ foreach $l (&find_directive_struct("LoadModule", $conf)) { undef(@get_config_cache); # Cache is no longer valid # Add dynamically loaded modules -&open_execute_command(APACHE, "$config{'apachectl_path'} -M 2>/dev/null", 1); -while() { - if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") { - push(@rv, "mod_${1}"); +if ($config{'apachectl_path'}) { + &open_execute_command(APACHE, + "$config{'apachectl_path'} -M 2>/dev/null", 1); + while() { + if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") { + push(@rv, "mod_${1}"); + } } + close(APACHE); } -close(APACHE); return &unique(@rv); }