Xampp MS SQL 服务器 PHP 5.6

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27126338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:12:00  来源:igfitidea点击:

Xampp MS SQL server PHP 5.6

phpsql-serverxamppphp-5.6

提问by Finduilas

I have a xampp running with PHP 5.6. Normally I use mysql server, but for a script that already exists i need a MS SQL server.

我有一个运行 PHP 5.6 的 xampp。通常我使用 mysql 服务器,但对于已经存在的脚本,我需要一个 MS SQL 服务器。

I searched on the net and installed SQL server 2012.

我在网上搜索并安装了 SQL Server 2012。

But now I need the drivers for PHP. Unfornunately I can only find a version that supports 5.4, 5.5..

但现在我需要 PHP 的驱动程序。不幸的是,我只能找到支持 5.4、5.5 的版本。

(http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)

( http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)

Is there a way to let this work with 5.6?

有没有办法让它在 5.6 中工作?

采纳答案by Finduilas

I searched the net for a while.. After posting this question for 10m, I finally found a unofficial driver..

网上搜了一阵。。这个问题发了10m,终于找到了一个非官方的驱动。。

Hope this works, I will check this out..

希望这有效,我会检查一下..

You can find it on: http://robsphp.blogspot.be/2012/06/unofficial-microsoft-sql-server-driver.html

您可以在以下位置找到它:http: //robsphp.blogspot.be/2012/06/unofficial-microsoft-sql-server-driver.html

回答by peterpoe

Microsoft recently released a new version (3.2) of the SQL Drivers for PHP which includes compatibility with PHP 5.6.

Microsoft 最近发布了新版本的 SQL Drivers for PHP (3.2),其中包括与 PHP 5.6 的兼容性。

You can download the drivers here: https://www.microsoft.com/en-us/download/details.aspx?id=20098

您可以在此处下载驱动程序:https: //www.microsoft.com/en-us/download/details.aspx?id=20098

回答by Paras Parmar

I believe it's time to revisit this answer a bit better. Since you've been pretty clear with your setup. The short answer is placed as steps below

我相信是时候更好地重新审视这个答案了。因为你已经很清楚你的设置了。简短的回答按以下步骤放置

  1. Download ver 3.2of the SQLSRV drivers from here. https://www.microsoft.com/download/details.aspx?id=20098
  2. Do extract them to your "xampp installation path"\php\ext
  3. Kindly ensure you see and keepthe files : php_sqlsrv_56_ts.dll and php_pdo_sqlsrv_56_ts.dll
  4. Please delete the redundant files below:

    PHP Drivers License Terms.rtf,
    php_pdo_sqlsrv_54_nts.dll,
    php_pdo_sqlsrv_54_ts.dll,
    php_pdo_sqlsrv_55_nts.dll,
    php_pdo_sqlsrv_55_ts.dll,
    php_pdo_sqlsrv_56_nts.dll,
    php_sqlsrv_54_nts.dll,
    php_sqlsrv_54_ts.dll,
    php_sqlsrv_55_nts.dll,
    php_sqlsrv_55_ts.dll,
    php_sqlsrv_56_nts.dll,
    release.txt,
    SQLSRV_Readme.htm,
    SQLSRV_ThirdPartyNotices.rtf,
    
    • Place these lines in your php.ini at your "xampp installation path"\php\php.ini extension=php_sqlsrv_56_ts.dll extension=php_pdo_sqlsrv_56_ts.dll

    • Restart your XAMPP server and place a '<'?php phpinfo(); ?'>' in an index.php file at \htdocs\'folder'

    • Navigate to it using http://localhost/'folder where phpinfofile is placed'/index.php

  1. 从此处下载SQLSRV 驱动程序的3.2 版https://www.microsoft.com/download/details.aspx?id=20098
  2. 将它们解压到您的“xampp 安装路径”\php\ext
  3. 请确保您查看并保留文件:php_sqlsrv_56_ts.dll 和 php_pdo_sqlsrv_56_ts.dll
  4. 请删除以下多余文件:

    PHP Drivers License Terms.rtf,
    php_pdo_sqlsrv_54_nts.dll,
    php_pdo_sqlsrv_54_ts.dll,
    php_pdo_sqlsrv_55_nts.dll,
    php_pdo_sqlsrv_55_ts.dll,
    php_pdo_sqlsrv_56_nts.dll,
    php_sqlsrv_54_nts.dll,
    php_sqlsrv_54_ts.dll,
    php_sqlsrv_55_nts.dll,
    php_sqlsrv_55_ts.dll,
    php_sqlsrv_56_nts.dll,
    release.txt,
    SQLSRV_Readme.htm,
    SQLSRV_ThirdPartyNotices.rtf,
    
    • 将这些行放在 php.ini 中的“xampp 安装路径”\php\php.ini extension=php_sqlsrv_56_ts.dll extension=php_pdo_sqlsrv_56_ts.dll

    • 重新启动您的 XAMPP 服务器并放置一个 '<'?php phpinfo(); ?'>' 位于 \htdocs\'folder' 的 index.php 文件中

    • 使用http://localhost/'放置 phpinfofile 的文件夹'/index.php导航到它

If you see something like this image below. It's done, Congratulations![enter image description here]1

如果你看到下面这张图。大功告成,恭喜![在此处输入图片说明] 1

PS : The long answer is here. https://msdn.microsoft.com/en-us/library/cc296170.aspx

PS:长答案在这里。 https://msdn.microsoft.com/en-us/library/cc296170.aspx

回答by Blarz

At this time: My solution was:

此时:我的解决方案是:

1- Download ver 3.2 of the SQLSRV drivers from here. https://www.microsoft.com/download/details.aspx?id=20098enter image description here

1- 从这里下载 SQLSRV 驱动程序的 3.2 版。https://www.microsoft.com/download/details.aspx?id=20098在此处输入图片说明

2 Extract the files to your "xampp" folder into the \php\ext

2 将文件解压到您的“xampp”文件夹到 \php\ext

3- Add this lines to php.ini

3- 将此行添加到 php.ini

extension=php_pdo_sqlsrv_56_ts.dll

扩展名=php_pdo_sqlsrv_56_ts.dll

extension=php_pdo_sqlsrv_56_nts.dll

扩展名=php_pdo_sqlsrv_56_nts.dll

extension=php_sqlsrv_56_ts.dll

扩展名=php_sqlsrv_56_ts.dll

extension=php_sqlsrv_56_nts.dll

扩展名=php_sqlsrv_56_nts.dll