Skip to content

Commit c457ed6

Browse files
author
Till Brehm
committed
Implements #5725 Installer: Check for required PHP modules
1 parent be8697b commit c457ed6

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

install/install.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
$retval=shell_exec("which which");
151151
if (empty($retval)) die ("ISPConfig requieres which \n");
152152

153+
$inst->check_prerequisites();
154+
153155
swriteln($inst->lng(' Following will be a few questions for primary configuration so be careful.'));
154156
swriteln($inst->lng(' Default values are in [brackets] and can be accepted with <ENTER>.'));
155157
swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n"));

install/lib/installer_base.lib.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ public function find_installed_apps() {
198198

199199
if (($conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) || ($conf['nginx']['installed'] && is_file($conf['nginx']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost"))) $this->ispconfig_interface_installed = true;
200200
}
201+
202+
//** Check prerequisites
203+
public function check_prerequisites() {
204+
$msg = '';
205+
206+
if(version_compare(phpversion(), '5.4', '<')) $msg .= "PHP Version 5.4 or newer is required.\n";
207+
if(!function_exists('curl_init')) $msg .= "PHP Curl Module is missing.\n";
208+
if(!function_exists('mysqli_connect')) $msg .= "PHP MySQLi Module is nmissing.\n";
209+
if(!function_exists('mb_detect_encoding')) $msg .= "PHP Multibyte Module (MB) is nmissing.\n";
210+
211+
if($msg != '') die($msg);
212+
}
201213

202214
public function force_configure_app($service, $enable_force=true) {
203215
$force = false;

install/update.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n");
189189
$inst->is_update = true;
190190

191+
$inst->check_prerequisites();
192+
191193
echo "This application will update ISPConfig 3 on your server.\n\n";
192194

193195
//* Make a backup before we start the update

0 commit comments

Comments
 (0)