Installer now checks that MySQL extension is present - see bug 1982

This commit is contained in:
moodler 2004-09-23 05:40:53 +00:00
parent 8c3dba735b
commit fe51520688
2 changed files with 28 additions and 17 deletions

View file

@ -213,6 +213,15 @@ if ($INSTALL['stage'] == 3) {
}
}
if ($INSTALL['dbtype'] == 'mysql') { /// Check MySQL extension is present
if (!extension_loaded('mysql')) {
$errormsg = get_string('mysqlextensionisnotpresentinphp', 'install');
$nextstage = 3;
}
}
if (empty($errormsg)) {
$db = &ADONewConnection($INSTALL['dbtype']);
error_reporting(0); // Hide errors
@ -234,6 +243,7 @@ if ($INSTALL['stage'] == 3) {
}
}
}
}
error_reporting(7);

View file

@ -110,6 +110,7 @@ $string['memorylimithelp'] = "
<p>However, on some servers this will prevent <b>all</b> PHP pages from working
(you will see errors when you look at pages) so you'll have to remove the .htaccess file.
</ol>";
$string['mysqlextensionisnotpresentinphp'] = 'PHP has not been properly configured with the MySQL extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP.';
$string['pass'] = 'Pass';
$string['phpversion'] = 'PHP version';
$string['phpversionerror'] = 'PHP version must be at least 4.1.0';