Skip to content

Commit cc45abd

Browse files
author
Florian Schaal
committed
add minimum php-version 5.3.3 to installer and updater
1 parent 7ba2f51 commit cc45abd

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

install/install.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
//** Installer Interface
140140
//****************************************************************************************************
141141
$inst = new installer();
142+
if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n");
142143

143144
swriteln($inst->lng(' Following will be a few questions for primary configuration so be careful.'));
144145
swriteln($inst->lng(' Default values are in [brackets] and can be accepted with <ENTER>.'));
@@ -157,6 +158,13 @@
157158
die('ISPConfig 3 installation found. Please use update.php instead if install.php to update the installation.');
158159
}
159160

161+
//** Detect php-version
162+
$MIN_PHP='5.6';
163+
if (version_compare(PHP_VERSION, $MIN_PHP, '<')) {
164+
echo 'ISPConfig requieres PHP '.$MIN_PHP.'. Installed version: ' . PHP_VERSION . "\n";
165+
}
166+
167+
160168
//** Detect the installed applications
161169
$inst->find_installed_apps();
162170

install/lib/installer_base.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class installer_base {
3636
public $conf;
3737
public $install_ispconfig_interface = true;
3838
public $is_update = false; // true if it is an update, falsi if it is a new install
39+
public $min_php = '5.3.3'; // minimal php-version for update / install
3940
protected $mailman_group = 'list';
4041

4142

@@ -130,6 +131,11 @@ function request_language(){
130131
}
131132
*/
132133

134+
//** Detect PHP-Version
135+
public function get_php_version() {
136+
if(version_compare(PHP_VERSION, $this->min_php, '<')) return false; else return true;
137+
}
138+
133139
//** Detect installed applications
134140
public function find_installed_apps() {
135141
global $conf;

install/update.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
175175

176176
$inst = new installer();
177+
if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n");
177178
$inst->is_update = true;
178179

179180
//** Detect the installed applications

0 commit comments

Comments
 (0)