第一次用Win7x64+Apache2.4+MSsql2012/2008+PHP5.6.9搭建WAMP来做网站,Apache已经装好,PHP也连上了,现在卡在了连接SQL的地方。
在微软官网Microsoft Drivers for PHP for SQL Server上下载了SQLSRV32.EXE,使用了php_sqlsrv_56_ts.dll和php_pdo_sqlsrv_56_ts.dll,按着网上的各种配置要求改做的都做了,但是依然报错Fatal error: Call to undefined function sqlsrv_connect() in D:\WAMP\Apache24\htdocs\phpinfo.php on line 16,能想到的办法都试过了,还是不行,还请各位指导!_
PS:
1.ntwdblib.dll_2000.80.194.0用的这个,拷在了D:\WAMP\php下和C:\Windows\System32下。
2.这一系列操作也做了[运行 SQL Server 配置管理器:SQL Server Configuration Manager,打开协议 Protocols, 允许命名管道 "named pipes" 和 "tcp/ip" , 右键点击 "tcp/ip",打开属性 Properties 标签 "IP addresses" ,在 TCP 动态端口 "TCP Dynamic Ports" 填入 1433 ]
3. php.ini里面 extension=php_sqlsrv_56_ts.dll extension=php_pdo_sqlsrv_56_ts.dll 都有,mssql.secure_connection = On也都有
4.apache服务器重启了很多次, httpd -k restart
5. test文件是D:\WAMP\Apache24\htdocs\phpinfo.php 内容见图片_
第一次自己做网站,搭建WAMP,MSsql连不上,实在不知道是为什么。请大家帮忙看看还能是什么原因?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
9条回答 默认 最新
- Carry_Dominator 2015-06-06 03:16关注
<connectionStrings> <add connectionString="server=.;uid=sa;pwd=401;database=VoteDB" name="connstr"/> </connectionStrings> public static DataTable GetTable(string strSql) { SqlConnection conn = CreatConn(); SqlCommand cmd = new SqlCommand(strSql, conn); SqlDataAdapter daap = new SqlDataAdapter(cmd); DataTable dtTable = new DataTable(); try { daap.Fill(dtTable); if (dtTable.Rows.Count > 0) return dtTable; else return null; } catch (Exception ex) { throw ex; } }
解决 无用评论 打赏 举报
悬赏问题
- ¥15 ads仿真结果在圆图上是怎么读数的
- ¥20 Cotex M3的调试和程序执行方式是什么样的?
- ¥20 java项目连接sqlserver时报ssl相关错误
- ¥15 一道python难题3
- ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
- ¥15 牛顿斯科特系数表表示
- ¥15 arduino 步进电机
- ¥20 程序进入HardFault_Handler
- ¥15 oracle集群安装出bug
- ¥15 关于#python#的问题:自动化测试