| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
global $CFG; |
|---|
| 6 |
|
|---|
| 7 |
$diemessages = array(); |
|---|
| 8 |
|
|---|
| 9 |
if ($CFG->dirroot == "") { |
|---|
| 10 |
$diemessages[] = 'Configuration problem: The <code>$CFG->dirroot</code> setting in config.php is empty.'; |
|---|
| 11 |
} elseif (substr($CFG->dirroot, -1) != "/") { |
|---|
| 12 |
$diemessages[] = 'Configuration problem: The <code>$CFG->dirroot</code> setting in config.php must end with a forward slash (/).'; |
|---|
| 13 |
} elseif (!is_readable($CFG->dirroot)) { |
|---|
| 14 |
|
|---|
| 15 |
$diemessages[] = 'Configuration problem: The <code>$CFG->dirroot</code> setting in config.php points to a directory that can not be read.'; |
|---|
| 16 |
} |
|---|
| 17 |
|
|---|
| 18 |
if (!preg_match('#^https?://.+#', $CFG->wwwroot)) { |
|---|
| 19 |
$diemessages[] = 'Configuration problem: The <code>$CFG->wwwroot</code> setting in config.php is empty or not a valid URL.'; |
|---|
| 20 |
} elseif (substr($CFG->wwwroot, -1) != "/") { |
|---|
| 21 |
$diemessages[] = 'Configuration problem: The <code>$CFG->wwwroot</code> setting in config.php must end with a forward slash (/).'; |
|---|
| 22 |
} |
|---|
| 23 |
|
|---|
| 24 |
if ($CFG->dataroot == "") { |
|---|
| 25 |
$diemessages[] = 'Configuration problem: The <code>$CFG->dataroot</code> setting in config.php is empty.'; |
|---|
| 26 |
} elseif (substr($CFG->dataroot, -1) != "/") { |
|---|
| 27 |
$diemessages[] = 'Configuration problem: The <code>$CFG->dataroot</code> setting in config.php must end with a forward slash (/).'; |
|---|
| 28 |
} |
|---|
| 29 |
|
|---|
| 30 |
if (ini_get('register_globals')) { |
|---|
| 31 |
|
|---|
| 32 |
$diemessages[] = " |
|---|
| 33 |
Configuration problem: The PHP setting 'register_globals', which is a huge security risk, is turned on. |
|---|
| 34 |
There should be a line in the .htaccess file as follows: <code>php_flag register_globals off</code> |
|---|
| 35 |
If the line is present but has a # at the start, remove the # character. |
|---|
| 36 |
"; |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
switch ($CFG->dbtype) { |
|---|
| 41 |
case 'mysql': |
|---|
| 42 |
$funcheck = 'mysql_query'; |
|---|
| 43 |
break; |
|---|
| 44 |
case 'postgres7': |
|---|
| 45 |
$funcheck = 'pg_query'; |
|---|
| 46 |
break; |
|---|
| 47 |
} |
|---|
| 48 |
if (!function_exists($funcheck)) { |
|---|
| 49 |
|
|---|
| 50 |
$diemessages[] = " |
|---|
| 51 |
Installation problem: Can't find the PHP MySQL or Postgresql module. |
|---|
| 52 |
Even with PHP and MySQL or Postgresql installed, sometimes the module to connect them is missing. |
|---|
| 53 |
Please check your PHP installation. |
|---|
| 54 |
"; |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
if (count($diemessages)) { |
|---|
| 59 |
$diebody = '<html><body><h1>Elgg isn\'t ready to run. :(</h1><ul>'; |
|---|
| 60 |
$diebody .= '<li>' . implode("</li><li>", $diemessages) . '</li>'; |
|---|
| 61 |
$diebody .= '</ul><p>Please read the INSTALL and config-dist.php files for more information,'; |
|---|
| 62 |
$diebody .= '<a href="_elggadmin/">or click here to use the friendly installer</a>.</p>'; |
|---|
| 63 |
$diebody .= '</body></html>'; |
|---|
| 64 |
die($diebody); |
|---|
| 65 |
} else { |
|---|
| 66 |
unset($diemessages); |
|---|
| 67 |
} |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
?> |
|---|