Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.9.2
-
Fix Version/s: 2.0
-
Component/s: Database MS SQL, Database SQL/XMLDB
-
Labels:None
-
Environment:Microsoft Windows Server, Microsoft SQL Server, FastCGI, PHP 5.2.6
-
Database:Microsoft SQL
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_20_STABLE
Description
Add support for the new Microsoft SQL Server 2005 Driver for PHP that Microsoft recently released so that we can use this driver with Moodle and MSSQL.
It seems that we can't use this new Microsoft SQL Server 2005 PHP Driver (php_sqlsrv.dll) with Moodle 1.9.2. If you load the php_sqlsrv.dll extension in the php.ini file and then select the mssql_n driver ($CFG->dbtype = 'mssql_n'
when you run the Moodle setup Moodle displays the following error:
"PHP has not been properly configured with the MSSQL extension so that it can communicate with SQL*Server. Please check your php.ini file or recompile PHP."
Being able to use this new driver will make it much easier for those of us who work in "Microsoft only" IT institutions to get management approval for rolling out Moodle installations.
And it will be interesting to compare how large Moodle/MSSQL sites perform with this new driver versus sites using ODBTP and FreeTDS drivers.
The SQL Server 2005 Driver for PHP release announcement is on:
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3676216&SiteID=17
And the download address is:
http://www.microsoft.com/downloads/details.aspx?FamilyId=61BF87E0-D031-466B-B09A-6597C21A2E2A&displaylang=en
Issue Links
| This issue duplicates: | ||||
| MDL-15093 | Add support for Microsoft SQL Server Native PHP Driver |
|
|
|
Well,
there are some problems with the PHP driver provided by Microsoft.
The fist one is that in don't use any more the legacy mssql php driver function names (while both ODBTP and FreeTDS do that). It means that a new driver has to be written from scratch to use the new qlsrv_xxxx() functions present in the MS driver.
Until now we use intensively the PHP-ADOdb library to get cross-db functionality. It's mandatory for all Moodle 1.x releases, while in Moodle 2.x we have implemented a new DB layer that can use ADOdb and other (PDO, native...) drivers... but, in any case, driver is pretty new under PHP-ADOdb (was released some weeks ago), while once more both the ODBTP and FreeTDS work perfectly.
Also, there are big limitations about how the driver handles UTF-8 strings (and Moodle only works against UTF-8 DBs), requiring to be converted from/to UTF-16 in the PHP side. IMO, this is unacceptable, because that will make the driver really slow, having to convert everything. Once again, both ODBTP and FreeTDS handle that conversion perfectly (and transparently).
Finally, it seems that, since some versions ago, FreeTDS is the "official" MSSQL driver for PHP (i.e. PHP builds use FreeTDS). And TDS (the protocol) is, also, officially supported by MS since some months ago (making all the documentation publicly available and so on). While I can understand some "problems" about to use ODBTP (requires a new service in sever machine and so on), I think FreeTDS is enough "official" (both from PHP and MS) to use it, more if it uses the legacy mssql functions, is "gold" supported by ADOdb and works in UTF-8 mode perfectly.
The alternative isn't, right now, good enough to switch. I agree one driver can arrive in the future but, sincerely, I think we should wait a bit until the (cool) MS driver evolves a bit.
Ciao