php 如何配置 XAMPP 以与 MSSQL 一起使用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32978554/
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:18:56  来源:igfitidea点击:

How to configure XAMPP to use with MSSQL?

phpxampp

提问by FernandoPaiva

I'm trying configure XAMPP to use with MSSQL. I'm following this: Examplebut I still had success.

我正在尝试将 XAMPP 配置为与 MSSQL 一起使用。我正在关注这个:示例,但我仍然取得了成功。

I copied the files: php_pdo_sqlsrv_54_ts.dlland php_sqlsrv_54_ts.dllto folder c:\xampp\php\extand configured php.iniin c:\xampp\php\php.ini.

我将 files: php_pdo_sqlsrv_54_ts.dlland复制到文件php_sqlsrv_54_ts.dllc:\xampp\php\extphp.inic:\xampp\php\php.ini.

In php.iniI activated the extensions: extension=php_pdo_sqlsrv_54_ts.dlland extension=php_sqlsrv_54_ts.dlland created PDO section. [Pdo_sqlsrv] pdo_sqlsrv.log_severity=-1.

php.ini我激活了扩展:extension=php_pdo_sqlsrv_54_ts.dllextension=php_sqlsrv_54_ts.dll创造PDO部分。[Pdo_sqlsrv] pdo_sqlsrv.log_severity=-1.

I am using XAMPP v3.2.1 and PHP 5.6.11

我正在使用 XAMPP v3.2.1 和 PHP 5.6.11

How could I make this works ?

我怎么能让这个工作?

回答by rray

For PHP5.6 vou need download SQLSRV32.EXE, after it put the php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll on ext folder and finally register those extension on php.ini, like this:

对于PHP5.6 VOU需要下载SQLSRV32.EXE,它放在ext文件夹的php_pdo_sqlsrv_56_ts.dll和php_sqlsrv_56_ts.dll后,终于在登记php.ini中的延伸,就像这样:

extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll

Restart apache and try phpinfo()or you could use getAvailableDrivers()

重新启动 apache 并尝试phpinfo()或者您可以使用getAvailableDrivers()

<?php
   echo "<pre>";
   print_r(PDO::getAvailableDrivers());

回答by Daniel Beltrami

After a long time...

经过很长一段时间...

I am 3 days with this problem, with me only resolved after adding the correct versionsof the PDO driver on this link.

我有 3 天遇到这个问题,只有在此链接上添加正确版本的 PDO 驱动程序后才解决。

My windows is 64x, but the XAMP is 86x. I only noticed after running phpinfo()

我的 windows 是64x,但 XAMP 是86x。我只在运行 phpinfo() 后才注意到

Note that the version you must add to the \ext folder is not the operating system version but rather the xamp installation, just like the image below:

请注意,您必须添加到 \ext 文件夹中的版本不是操作系统版本,而是 xamp 安装,如下图所示:

enter image description here

在此处输入图片说明