php7.1 添加 sqlserver 扩展

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"

成功:

091610_87TD_1586492.png

 

测试发现有问题:

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

跑起来真不容易,尤其在生产环境。

 

转载于:https://my.oschina.net/famoustone/blog/907065

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值