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

2022-01-14 00:00:00 xampp php

我正在尝试将 XAMPP 配置为与 MSSQL 一起使用.我正在关注这个:Example 但我还是成功了.

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

我将文件: php_pdo_sqlsrv_54_ts.dllphp_sqlsrv_54_ts.dll 复制到文件夹 c:xamppphpext 并配置 >php.inic:xamppphpphp.ini 中.

I copied the files: php_pdo_sqlsrv_54_ts.dll and php_sqlsrv_54_ts.dll to folder c:xamppphpext and configured php.ini in c:xamppphpphp.ini.

php.ini 我激活了扩展:extension=php_pdo_sqlsrv_54_ts.dllextension=php_sqlsrv_54_ts.dll 并创建了 PDO 部分.<代码>[Pdo_sqlsrv]pdo_sqlsrv.log_severity=-1.

In php.ini I activated the extensions: extension=php_pdo_sqlsrv_54_ts.dll and extension=php_sqlsrv_54_ts.dll and created PDO section. [Pdo_sqlsrv] pdo_sqlsrv.log_severity=-1.

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

I am using XAMPP v3.2.1 and PHP 5.6.11

我怎样才能使它工作?

推荐答案

PHP5.6需要下载SQLSRV32.EXE,将 php_pdo_sqlsrv_56_ts.dll 和 php_sqlsrv_56_ts.dll 放到 ext 文件夹中,最后在 php.ini 上注册这些扩展,如下所示:

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:

extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll

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

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

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

相关文章