diff --git a/lang/en/install.php b/lang/en/install.php index 78e7705d77a..aceb61fca90 100644 --- a/lang/en/install.php +++ b/lang/en/install.php @@ -356,6 +356,8 @@ $string['skipdbencodingtest'] = 'Skip DB encoding test'; $string['nativesqlsrv'] = 'SQL*Server Microsoft (native/sqlsrv)'; $string['nativesqlsrvhelp'] = 'Now you need to configure the database where most Moodle data will be stored. This database must already have been created and a username and password created to access it. Table prefix is mandatory.'; +$string['nativesqlsrvnodriver'] = 'Microsoft Drivers for SQL Server for PHP are not installed or not configured properly.'; +$string['nativesqlsrvnonwindows'] = 'Microsoft Drivers for SQL Server for PHP are available only for Windows OS.'; $string['sqliteextensionisnotpresentinphp'] = 'PHP has not been properly configured with the SQLite extension. Please check your php.ini file or recompile PHP.'; $string['upgradingqtypeplugin'] = 'Upgrading question/type plugin'; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index b2b0e6066a1..90ec10479e5 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -64,7 +64,11 @@ class sqlsrv_native_moodle_database extends moodle_database { // the name used by 'extension_loaded()' is case specific! The extension // therefore *could be* mixed case and hence not found. if (!function_exists('sqlsrv_num_rows')) { - return get_string('sqlsrvextensionisnotpresentinphp', 'install'); + if (stripos(PHP_OS, 'win') === 0) { + return get_string('nativesqlsrvnodriver', 'install'); + } else { + return get_string('nativesqlsrvnonwindows', 'install'); + } } return true; }