PHP5连接MSSQL 2005的方法

| |
[阴 2008/04/03 17:07 | by Doctor ]

一个Case需要使用PHP5连接MS SQL Server 2005,找了些资料自己琢磨了下,搞定了,呵呵

环境:
- Apache 2.2.6
- PHP 5.2.5
- SQL Server 2005
- Windows XP SP2


步骤:

1. 首先按通常做法配置好PHP5连接MS SQL Server
2. 下载正确版本的 ntwdblib.dll (2000.80.194.0),地址: http://webzila.com/dll/1/ntwdblib.zip
3. 覆盖 apache2.2.6\bin\ntwdblib.dll
4. 覆盖 php5.2.5\ntwdblib.dll
5. 运行 SQL Server 配置管理器:SQL Server Configuration Manager,打开协议 Protocols
6. 允许命名管道 "named pipes" 和 "tcp/ip"
7. 右键点击 "tcp/ip",打开属性 Properties 标签 "IP addresses"
8. 在 TCP 动态端口 "TCP Dynamic Ports" 填入 1433
9. 重启 SQL Server、Apache和PHP

使用以下方式连接MS SQL Server 2005:
mssql_connect('localhost,1433', USERNAME, PASSWORD);

Tags: , , , , ,
PHP&DB&... | 评论(0) | 引用(0) | 阅读(671)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]