mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-27 15:40:00 +01:00
fixed error during install, where "apache_get_modules" is not available
This commit is contained in:
parent
f191979f9b
commit
413c026dc7
1 changed files with 14 additions and 9 deletions
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
session_start();
|
||||
if (!($_SESSION["docroot"]))
|
||||
{
|
||||
session_start();
|
||||
if (!($_SESSION["docroot"]))
|
||||
{
|
||||
$_SESSION["docroot"] = str_replace("/install", "", __DIR__);
|
||||
}
|
||||
}
|
||||
|
||||
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
|
||||
header("Pragma: no-cache"); // HTTP 1.0.
|
||||
|
@ -12,14 +12,19 @@ if (!($_SESSION["docroot"]))
|
|||
|
||||
$mods_enabled = array("mod_rewrite");
|
||||
$missing_mods = array();
|
||||
if(function_exists("apache_get_modules")){
|
||||
$apache_mods = apache_get_modules();
|
||||
foreach($mods_enabled as $mod){
|
||||
if(!(in_array($mod, apache_get_modules()))){
|
||||
if(!(in_array($mod, $apache_mods))){
|
||||
array_push($missing_mods, $mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!(class_exists('mysqli'))){ #php-mysql not installed
|
||||
array_push($missing_mods, "mysql");
|
||||
}
|
||||
|
||||
if(sizeof($missing_mods)>0){
|
||||
header("Location: /cont/error.php?id=php_modules&missing_mods=".serialize($missing_mods));
|
||||
}
|
||||
|
@ -28,7 +33,7 @@ if (!($_SESSION["docroot"]))
|
|||
header("Location: /");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/style/master.css">
|
||||
|
|
Loading…
Reference in a new issue