From 98534e4fa28b27727445f56414718de0a4d99968 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 27 Oct 2014 19:46:33 +0100 Subject: install.php: Check for PHP modules Signed-off-by: Florian Pritz --- install.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install.php b/install.php index 0c4f427c1..df3868074 100644 --- a/install.php +++ b/install.php @@ -68,6 +68,23 @@ if ($buf != "0") { $errors .= " - Error when testing qrencode: Return code was \"$buf\".\n"; } +// test PHP modules +$mod_groups = array( + "thumbnail generation" => array("gd"), + "database support" => array("mysql", "mysqli", "pgsql", "pdo_mysql", "pdo_pgsql"), +); +foreach ($mod_groups as $function => $mods) { + $found = 0; + foreach ($mods as $module) { + if (extension_loaded($module)) { + $found++; + } + } + if ($found == 0) { + $errors .= " - none of the modules needed for $function are loaded. Make sure to load at least one of these: ".implode(", ", $mods)."\n"; + } +} + if ($errors != "") { echo nl2br("Errors occured:\n"); -- cgit v1.2.3-24-g4f1b