Microsoft 地址:(只支持到php7.0)
https://www.microsoft.com/en-us/download/details.aspx?id=20098
扩展地址(7.1):
https://github.com/Microsoft/msphpsql/releases/tag/v4.1.3-Windows
php.ini
[SQlSERVER]
extension="php_odbc.dll"
extension="php_pdo_sqlsrv_7_ts.dll"
extension="php_sqlsrv_7_ts.dll"
成功:
测试发现有问题:
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 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC �������������] δ��������Դ���Ʋ���δָ��Ĭ���������� [message] => [Microsoft][ODBC �������������] δ��������Դ���Ʋ���δָ��Ĭ���������� ) )
根据提示现在odbc:
https://www.microsoft.com/en-us/download/confirmation.aspx?id=50420
折腾半天按照微软官方的pdf文档,编译不了。提示sql.h不存在
参考网站:
http://php.net/manual/zh/sqlsrv.installation.php
http://www.thinkphp.cn/topic/47058.html
https://github.com/Microsoft/msphpsql/releases
跑起来真不容易,尤其在生产环境。