简体   繁体   中英

PHP MsSQL WAMP - Couldn't connect to MSSQL

I've downloaded SQLSRV32.EXE from the official MSSQL Driver for PHP and extracted php_sqlsrv_56_ts.dll & php_pdo_sqlsrv_56_ts.dll into C:\\wamp\\bin\\php\\php5.6.19\\ext

Added the following declaration in the php.ini from the WAMP menu.

extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll

I then run the sample code from the reference page .

I couldn't connect to the MS SQL Server due to the following error

Connection could not be establish
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 ) )

I've tried to download the ODBC Driver 13 (for Windows 10) but it is not working. Can someone tell me what I'm doing wrong?

版本不兼容

As I can see - ODBC Driver 13 is not supported on your system and the required one is ODBC Driver 11.

https://www.microsoft.com/en-us/download/details.aspx?id=36434

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM