Toss for a long time, finally finally connected success!
Note: I use the phpstudy.
Configuration in php.ini:
This is the driver extension =php_sqlsrv in PHP. dllextension=php_pdo_sqlsrv.dll
Download install Microsoft SQL Server Native Client ODBC driver X64 (64-bit Win7 on my computer).
I am using the thinkphp framework, which is configured as follows:
<? PHP return Array ( ' url_model ' =/ / If your environment does not support pathinfo please set it to 3 ' db_type ' = ' sqlsrv ', ' db_host ' = ' localhost ', ' db_name ' = ' Northwind ' , ' Db_user ' + ' sa ', ' db_pwd ' and ' = ', ' db_port ' = ' 1433 ' , ' Db_prefix ' = ' , ' app_autoload_path ' and ' @ ' . TagLib ', ' app_group_list ' = ' home,admin ', ' default_group ' = ' Home ', ' app_group_mode ' = 1, ' show_page_trace ' + 1// display debug information );
A simple test:
class extends action{ publicfunction index () { $Model = M (' Customers '), select (); Var_dump $Model ); } .....
PHP High version of the MSSQL support configuration is more complicated than 5.2 so simple,
Version 5.5, 5.6 failed to debug this method through, do not know what the reason.
Connection configuration for MS SQL Server on PHP version 5.4