php5.3 Connection sqlserver2005

Source: Internet
Author: User
Tags vc9

Operating system: XP

php5.3以后,已经不对sqlserver支持连接扩展了,不过微软官方还是对php5.3以后进行了扩展解决方案。 1.确认要连接sqlserver的数据库版本为2005 2.确认php支持的vc9还是vc6,这里可以从phpinfo()里看出来。 3.确认php的版本为5.3,并且确认php是否线程安全,可以再phpinfo()里看出来。 3.根据上面到微软官方下载扩展。或者直接下载附件。 2,3点在phpinfo里的Zend Extension Build这个属性中可以看出来。 如:API220090626,TS,VC9    TS代表线程安全,VC9版本的扩展。 API220090626,NTS,VC6      NTS代表非现成安全,VC6版本的扩展。 TS,VC9    将php_pdo_sqlsrv_53_ts_vc9.dll,php_sqlsrv_53_ts_vc9.dll这两个扩展赋值到php/ext目录下。 TS,VC6    将php_pdo_sqlsrv_53_ts_vc6.dll,php_sqlsrv_53_ts_vc6.dll这两个扩展赋值到php/ext目录下。 NTS,VC9   将php_pdo_sqlsrv_53_nts_vc9.dll,php_sqlsrv_53_nts_vc9.dll这两个扩展赋值到php/ext目录下。 NTS,VC6   将php_pdo_sqlsrv_53_nts_vc6.dll,php_sqlsrv_53_nts_vc6.dll这两个扩展赋值到php/ext目录下。 同时,打开php.ini文件,写入下面代码 extension=复制在ext下的pdo扩展 //一定要对应 extension=复制在ext下的扩展 //一定要对应 一个php_pdo_sqlsrv对应一个php_sqlsrv 完成上面操作后。重启iis. 打开phpinfo(); 可以查询PDO  pdo项里包括sqlsrv 查询pdo_sqlsrv   如果上面都存在,则php5.3连接sqlserver2005已经成功了。。 然后写个测试连接的实例,测试成功。Driver Download: sql-server-driver-for-php

php5.3 Connection sqlserver2005

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.