在WampServer上安装php_ [pdo_] mssql.dll后,“错误!:找不到驱动程序” [英] 'Error!: could not find driver' after installing php_[pdo_]mssql.dll on WampServer

查看:510
本文介绍了在WampServer上安装php_ [pdo_] mssql.dll后,“错误!:找不到驱动程序”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似的问题 即将成为 在互联网,但到目前为止没有任何帮助。

Similar questions seem to be all over the internet, but so far nothing has helped.

我目前正在运行 WampServer 在Windows Server 2008 R2上使用Apache 2.4.4和PHP 5.4.12。 根据PHP文档连接到MSSQL服务器所需的驱动程序配送配送;他们不。 php_mssql.dll (该文档声明不再需要PHP5.4,但仍在 php.ini 。谁知道)和 php_pdo_mssql.dll 存在于发行版中。

I'm currently running WampServer with Apache 2.4.4 and PHP 5.4.12 on Windows Server 2008 R2. According to the PHP documentation the drivers necessary to connect to an MSSQL server ship with the distribution; they do not. Neither php_mssql.dll (which the documentation claims is no longer necessary for PHP5.4, but which is still referenced in php.ini. Who knows) nor php_pdo_mssql.dll are present in the distribution.

几个来源指向<来自Microsoft的这些驱动程序的href =http://www.microsoft.com/en-us/download/details.aspx?id=20098 =nofollow noreferrer,但是我没有成功将相应的驱动程序重命名为 php_mssql.dll / php_pdo_mssql.dll 或保持名称相同( php_sqlsrv_54_nts.dll php_pdo_sqlsrv_54_ts.dll 等)并修改 php.ini 指向正确的司机。虽然我在启动apache时没有发现错误,当驱动程序完全丢失时,我收到错误!:尝试指向测试时找不到驱动程序 php页面在本地主机。

Several sources pointed to these drivers from Microsoft, however I had no success either renaming the respective drivers to php_mssql.dll/php_pdo_mssql.dll or keeping the names the same (php_sqlsrv_54_nts.dll, php_pdo_sqlsrv_54_ts.dll, etc.) and modifying php.ini to point to the proper driver. Though I didn't get an error upon starting apache as I do when the driver is simply missing, I received Error!: could not find driver when attempting to point to a test php page at localhost.

这篇文章似乎是最有希望的,但不幸的是 ntwdblib.dll 不是包含在PHP的zip分发中,与文章所声称的相反。这似乎应该是一个可笑的简单问题:缺少司机,据说是随时可用的。而在这里我是...我做错了什么?

This article seemed the most promising, but unfortunately ntwdblib.dll is not included in the zip distributions of PHP, contrary to what the article claims. This seems like it should be a laughably simple problem: missing drivers, which are supposedly readily available. And yet here I am... What am I doing wrong?

推荐答案

如果有人在尝试解决这个问题这个问题,这是为我做的两次工作的步骤。这些步骤在Windows Server 2008 R2和Windows 8上都有效。

In case anyone else ends up here while trying to solve this problem, here are the steps that have worked for me the two times I've done it. These steps worked both on Windows Server 2008 R2 and Windows 8.

为了我的目的,我使用了最新的32位(x86)版本的 WampServer (在撰写本文时,它是2.4,并附带Apache 2.4.4和PHP 5.4.16)。 32位版本是必需的,因为驱动程序是32位的; 64位版本将无法正常工作。

For my purposes, I used the latest 32-bit (x86) version of WampServer (at the time of this writing, it was 2.4, and came with Apache 2.4.4 and PHP 5.4.16). The 32-bit version is necessary, as the drivers are 32-bit; the 64-bit version will not work.


  1. 安装 Microsoft Visual C ++ 2010可再发行组件包x86

  2. 安装 Microsoft SQL Server 2008 Native Client x86 (点击下载并选择 ENU\x86\sqlncli.msi 再次,64位版本将无法正常工作

  3. 安装 Microsoft ODBC驱动程序11 x86 (点击下载并选择 1033\x86\msodbcsql.msi

  4. 安装 Microsoft SQLSRV驱动程序3.0 php / ext / (对于我的安装,这是 C:/wamp/bin/php/php5.4.16/ext /

  5. 编辑<斯特龙g> Apache的 php.ini包含行 extension = php_pdo_sqlsrv_54_ts.dll (对于我的安装,它位于 C:/ wamp / bin / apache / Apache2.4.4 / bin /

  1. Install Microsoft Visual C++ 2010 Redistributable Package x86
  2. Install Microsoft SQL Server 2008 Native Client x86 (Click "Download" and select ENU\x86\sqlncli.msi. Once again, the 64-bit version will not work)
  3. Install Microsoft ODBC Driver 11 x86 (Click "Download" and select 1033\x86\msodbcsql.msi)
  4. Install Microsoft SQLSRV driver 3.0 in php/ext/ (For my installation, this was C:/wamp/bin/php/php5.4.16/ext/)
  5. Edit Apache's php.ini to include the line extension=php_pdo_sqlsrv_54_ts.dll (for my installation, this was located in C:/wamp/bin/apache/Apache2.4.4/bin/)

这篇关于在WampServer上安装php_ [pdo_] mssql.dll后,“错误!:找不到驱动程序”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆