fixed error during install, where "apache_get_modules" is not available

This commit is contained in:
Krehan Tim 2018-11-12 09:02:43 +01:00
parent f191979f9b
commit 413c026dc7

View file

@ -1,9 +1,9 @@
<?php <?php
session_start(); session_start();
if (!($_SESSION["docroot"])) if (!($_SESSION["docroot"]))
{ {
$_SESSION["docroot"] = str_replace("/install", "", __DIR__); $_SESSION["docroot"] = str_replace("/install", "", __DIR__);
} }
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1. header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0. header("Pragma: no-cache"); // HTTP 1.0.
@ -12,14 +12,19 @@ if (!($_SESSION["docroot"]))
$mods_enabled = array("mod_rewrite"); $mods_enabled = array("mod_rewrite");
$missing_mods = array(); $missing_mods = array();
foreach($mods_enabled as $mod){ if(function_exists("apache_get_modules")){
if(!(in_array($mod, apache_get_modules()))){ $apache_mods = apache_get_modules();
array_push($missing_mods, $mod); foreach($mods_enabled as $mod){
if(!(in_array($mod, $apache_mods))){
array_push($missing_mods, $mod);
}
} }
} }
if(!(class_exists('mysqli'))){ #php-mysql not installed if(!(class_exists('mysqli'))){ #php-mysql not installed
array_push($missing_mods, "mysql"); array_push($missing_mods, "mysql");
} }
if(sizeof($missing_mods)>0){ if(sizeof($missing_mods)>0){
header("Location: /cont/error.php?id=php_modules&missing_mods=".serialize($missing_mods)); header("Location: /cont/error.php?id=php_modules&missing_mods=".serialize($missing_mods));
} }
@ -28,7 +33,7 @@ if (!($_SESSION["docroot"]))
header("Location: /"); header("Location: /");
exit; exit;
} }
?> ?>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/style/master.css"> <link rel="stylesheet" href="/style/master.css">