From d98228e497e8d95ac9ca72bc37152a6bb8e1d3c6 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 13 Jan 2003 14:05:29 +0000 Subject: [PATCH] More checks to solve support requests before they happen. --- admin/index.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/admin/index.php b/admin/index.php index b1c80d91b1..c84a261f4a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,11 +1,18 @@ You need to create a config.php.
+ See the installation instructions."; + die; + } + require_once("../config.php"); /// Check that PHP is of a sufficient version - if ( ! check_php_version("4.1.0") ) { + if (!check_php_version("4.1.0")) { $version = phpversion(); print_heading("Sorry, Moodle requires PHP 4.1.0 or later (currently using version $version)"); die; @@ -25,6 +32,19 @@ error("Moodle has not been configured yet. You need to to edit config.php first."); } + +/// Check settings in config.php + + $dirroot = dirname(realpath("../config.php")); + if ($dirroot != $CFG->dirroot) { + error("Please fix your settings in config.php: +

You have: +

\$CFG->dirroot = \"$CFG->dirroot\"; +

but it should be: +

\$CFG->dirroot = \"$dirroot\";"); + } + + /// Check if the main tables have been installed yet or not. if (! $tables = $db->Metatables() ) { // No tables yet at all. -- 2.39.5