Good morning,
We recently rolled out a new installation. Environment details are as follows.
OS: Windows Server 2012 R2
HTTP Daemon: IIS 8.5
Moodle: v2.8.2
PHP: 5.6.6
PHP DB connector: Unofficial Microsoft SQL Server Driver for PHP (sqlsrv) 3.0.2.2R from http://robsphp.blogspot.be/2012/06/unofficial-microsoft-sql-server-driver.html I'm using this version as it supports php 5.6.x.There were no problems getting this installation up and running after creating a database and an SQL user with the db_owner role for it. Our other Moodle installation running 2.4.4 uses FreeTDS along with NT Authentication for the database. I've yet to find a compiled dll of FreeTDS for PHP 5.6.x and decided to go use the sqlsrv driver. An AD account was created and granted privileges to the database. The user is working as confirmed by launching the SQL Management Studio as thatuser, connecting to the database with Windows authentication and successfully accessing the new database.
When I configure moodle (config.php) to use a that new account, Moodle doesn't connect. The following error shows up in the SQL Server logs.
Error: 18456, Severity: 14, State: 6.
Login failed for user '<our domain>\<database user>'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: x.x.x.x]
Error 18456 is a Login failure
State 6 is Attempt to use a Windows login name with SQL Authentication
Here is what I have setup in config.php
$CFG->dbtype = 'sqlsrv';
$CFG->dblibrary = 'native';
$CFG->dbhost = '<sql hostname>\<instance name>';
$CFG->dbname = '<the database name>';
$CFG->dbuser = '<our domain>\<database user>';
$CFG->dbpass = '<some magical password>';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
);
php.ini is setup with the following extension
extension=php_sqlsrv_56_nts.dll
..and phpinfo() reports that the extension is loaded.
So, I can successfully use SQL Server authentication, but unable to with Windows authentication. Does anyone have a suggestion on what to check next?
Thank you,
-nils