diff --git a/app/Checks.php b/app/Checks.php index 2852b2c64d..594ac08244 100644 --- a/app/Checks.php +++ b/app/Checks.php @@ -37,16 +37,16 @@ use Toastr; class Checks { - public static function preBoot() + public static function preAutoload() { - // check php extensions - if ($missing = self::missingPhpExtensions()) { + // Check PHP version otherwise it will just say server error + if (version_compare('7.1.3', PHP_VERSION, '>=')) { self::printMessage( - "Missing PHP extensions. Please install and enable them on your LibreNMS server.", - $missing, + 'PHP version 7.1.3 or newer is required to run LibreNMS', + null, true ); - } + }; } /** @@ -63,6 +63,18 @@ class Checks } } + public static function preBoot() + { + // check php extensions + if ($missing = self::missingPhpExtensions()) { + self::printMessage( + "Missing PHP extensions. Please install and enable them on your LibreNMS server.", + $missing, + true + ); + } + } + /** * Post boot Toast messages */ diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index cf096dd967..e6140b8d26 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,10 +14,9 @@ define('LARAVEL_START', microtime(true)); | */ +@require_once __DIR__ . '/../app/Checks.php'; +\App\Checks::preAutoload(); + @include __DIR__ . '/../vendor/autoload.php'; -if (!class_exists(\App\Checks::class)) { - require __DIR__ . '/../app/Checks.php'; -} - \App\Checks::postAutoload();