XAMPP 1.7.4, PHP 5.4, SQL Server 2008 R2

Recently I had problem connecting PHP 5.4 with SQL Server 2008 R2 using sqlsrv_connect() method.

After browsing through hundreds of pages, I found a bit clue in Federico Giust post here http://stackoverflow.com/questions/9824162/php-5-3-not-recognizing-native-client-to-connect-to-ms-sql.

I turn on process monitor for httpd, open php page that execute sqlsrv_connect(), and found out that there were problem in “HKLM\Software\ODBC\ODBCINST.INI\Sql Server Native Client 11.0″NOT FOUND.

I checked registry using “Registry Editor” tools, and there were no “HKLM\Software\ODBC\ODBCINST.INI\Sql Server Native Client 11.0”. There were “HKLM\Software\ODBC\ODBCINST.INI\Sql Server Native Client 10.0”.

My solution here is to rename “HKLM\Software\ODBC\ODBCINST.INI\Sql Server Native Client 10.0” to “HKLM\Software\ODBC\ODBCINST.INI\Sql Server Native Client 11.0”. After I rename, sqlsrv_connect() is working correctly.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.