【问题标题】:sqlsrv error while connecting to mssql server 2008 on windows 2003 server [duplicate]在 Windows 2003 服务器上连接到 mssql server 2008 时出现 sqlsrv 错误 [重复]
【发布时间】:2013-08-20 10:55:31
【问题描述】:

在使用 PHP 中的 sqlsrv_connect 在 Windows 2003 服务器上使用 sqlsrv 连接 mssql server 2008 时出现以下错误。已安装 Microsoft SQL Server 2008 Native Client。在 IIS 6.0 上运行的网络服务器

这里是 php.ini 的内容

=========================

[PHP_SQLSRV]
extension=php_sqlsrv_53_ts_vc9.dll
[PHP_PDO_SQLSRV]
extension=php_pdo_sqlsrv_53_nts_vc6.dll
php_pdo_sqlite.dll

=========================

Array
(
    [0] => Array
        (
            [0] => IMSSP
            [SQLSTATE] => IMSSP
            [1] => -49
            [code] => -49
            [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712
            [message] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712
        )

    [1] => Array
        (
            [0] => IM002
            [SQLSTATE] => IM002
            [1] => 0
            [code] => 0
            [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
            [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
        )

)

【问题讨论】:

    标签: php sql-server sql-server-2008 sqlsrv


    【解决方案1】:

    两种尝试方式,

    首先检查 Native 驱动的版本是否正确 -
    您的服务器真的是 32 位版本而不是 84 位吗?

    另一件事是,检查扩展是否实际加载。

    要检查这一点,请创建一个类似“phpinfo.php”的文件并将其放入您的 .htdocs 文件夹中。

    <?php
    
    // show phpinfo file
    phpinfo();
    
    ?>
    

    简单的方法是在 phpinfo-Page 中使用 Ctrl+F 和 "extension=php_sqlsrv_53_ts_vc9.dll" 搜索它

    【讨论】:

      【解决方案2】:
      1. 访问此网站:Microsoft download site
      2. 滚动到(+) Install Instructions 部分,然后单击它。
      3. 在此部分内滚动至:Microsoft® SQL Server® 2012 Native Client
      4. 您将在此处看到两个链接:安装其中一个(最多为您的系统 32 或 64)

      X86 包 (sqlncli.msi) X86 direct link

      X64 包 (sqlncli.msi) 直接在评论中链接

      【讨论】:

      【解决方案3】:

      确保安装 Microsoft SQL Server 2012 Native Client。 关注PHP requirement

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-17
        • 2011-09-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多