问题描述
我正在尝试配置XAMPP以与MSSQL一起使用.我正在追踪:示例,但我仍然成功.
I'm trying configure XAMPP to use with MSSQL. I'm following this: Example but I still had success.
我将文件php_pdo_sqlsrv_54_ts.dll
和php_sqlsrv_54_ts.dll
复制到文件夹c:\xampp\php\ext
,并在c:\xampp\php\php.ini
中配置了php.ini
.
I copied the files: php_pdo_sqlsrv_54_ts.dll
and php_sqlsrv_54_ts.dll
to folder c:\xampp\php\ext
and configured php.ini
in c:\xampp\php\php.ini
.
在php.ini
中,我激活了扩展:extension=php_pdo_sqlsrv_54_ts.dll
和extension=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());
这篇关于如何配置XAMPP与MSSQL一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!