diff --git a/lib/init.php b/lib/init.php index acc2375c..75d6e4f6 100644 --- a/lib/init.php +++ b/lib/init.php @@ -20,6 +20,17 @@ // define default theme for configurehint, etc. $_deftheme = 'Sparkle'; +// validate correct php version +if (version_compare("7.0.0", PHP_VERSION, ">=")) { + // get hint-template + $vendor_hint = file_get_contents(dirname(__DIR__) . '/templates/' . $_deftheme . '/misc/phprequirementfailed.tpl'); + // replace values + $vendor_hint = str_replace("", "7.0.0", $vendor_hint); + $vendor_hint = str_replace("", PHP_VERSION, $vendor_hint); + $vendor_hint = str_replace("", date('Y', time()), $vendor_hint); + die($vendor_hint); +} + if (! file_exists(dirname(__DIR__) . '/vendor/autoload.php')) { // get hint-template $vendor_hint = file_get_contents(dirname(__DIR__) . '/templates/' . $_deftheme . '/misc/vendormissinghint.tpl'); diff --git a/scripts/froxlor_master_cronjob.php b/scripts/froxlor_master_cronjob.php index 900929fc..d30fe4e8 100644 --- a/scripts/froxlor_master_cronjob.php +++ b/scripts/froxlor_master_cronjob.php @@ -14,6 +14,12 @@ * @package Cron * */ + +// validate correct php version +if (version_compare("7.0.0", PHP_VERSION, ">=")) { + die('Froxlor requires at least php-7.0. Please validate that your php-cli version and the cron execution command are correct.'); +} + require dirname(__DIR__) . '/vendor/autoload.php'; \Froxlor\Cron\MasterCron::setArguments($argv); diff --git a/templates/Sparkle/misc/phprequirementfailed.tpl b/templates/Sparkle/misc/phprequirementfailed.tpl new file mode 100644 index 00000000..40639184 --- /dev/null +++ b/templates/Sparkle/misc/phprequirementfailed.tpl @@ -0,0 +1,43 @@ + + + + + + + + + + Froxlor Server Management Panel - Requirements not met + + +
+ +
+
+ Froxlor Server Management Panel +
+ +
+
+
Whoops!
+
+

It seems you are using an older version of PHP

+

 

+

Froxlor requires at least PHP version
The installed version is:

+
+
+ +
+ +
+ +
+ + +