0

I am trying to connect to my MS SQL Server (2008 R2) with php and xampp. Upon running the code I got this error:

Connection could not be established.
Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 )

[1] => Array
    (
        [0] => IM002
        [SQLSTATE] => IM002
        [1] => 0
        [code] => 0
        [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
        [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    )

)

So, I decided to try to install the ODBC Driver 11. I could not install the driver on Windows 10 because it's not supported so I downloaded ODBC Driver 13 and it still did not work. Is there a way I can reconfigure ODBC Driver 13 so it will work in replace of ODBC Driver 11? If there is anything else I can provide that would be useful let me know. I cannot use MySQL for this, nor can I update SQL Server.

1 Answers1

0

PHP SQL Server Couldn't connect

PHP 5.5 and MSSQL driver: Installing ODBC Driver 11 in Windows Server 2012 R2

To make an addition, make sure you installed the correct version (32-bit vs 64 bit) of ODBC!

Know which version your system runs: your SQL server might be a different version.

Even if these questions don't solve it directly, they might contain useful information for your situation.

Refer to these questions; I think you should be able to find a solution.

The DLL file of ODBC might need to be copied under your working directory of PHP in addition to being installed.

I see that being a common problem with JDBC at least.

Good luck!

Community
  • 1
  • 1
anon
  • 1