Installing the sqlsrv Extension
First SQL Server 2014 installation does not say what the link information set itself
PHP Version: 5.5.12
Sqlsrv Drive Microsoft offers 3.0 and 3.1 version 3.0 corresponding to PHP 5.4 3.1 corresponding to 5.5
PS:WIN7 64-bit system
Download SQL Server Driver
Http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
- Version 3.0 supports PHP 5.4
- Version 3.1 supports PHP 5.5
http://www.microsoft.com/en-us/download/details.aspx?id=20098
Note that the official download of the 5.5 driver is not supported 64-bit environment I started using Wampserver 64-bit will not be able to load sqlsrv
Support 64-bit please come here to download the difference is the version 5.5 and 5.6
So here's the 64-bit address download for 5.5 and 5.6
Http://pan.baidu.com/s/1kT5PceN
And then put the download to the file
Php_pdo_sqlsrv_55_nts.dll
Php_pdo_sqlsrv_55_ts.dll
Php_sqlsrv_55_nts.dll
Php_sqlsrv_55_ts.dll
In the PHP installation directory under the EXT directory (ext is php5 after the directory)
PHP Configuration Load Open php.ini Search extension Add the following these please see for yourself php.ini location
extension=php_pdo_sqlsrv_55_nts.dllextension=php_pdo_sqlsrv_55_ts.dllextension=php_sqlsrv_55_nts.dllextension= Php_sqlsrv_55_ts.dll
Restart service does not restart should be able to recognize the
Check whether the load is loaded with the phpinfo () function
The following are the successful
And then just write a test TP3.2.3.
Public function ABC () { $User = M (' info ', ' dbo. ', ' sqlsrv://sa:[email protected]\mssql/xxx '); $s = $User->select (); Dump ($s); }
database table Display
Visit: http://localhost:8080/index.php/Home/Category/abc.html
thinkphp 3.2.3 Connecting SQL Server 2014