如何在xampp中使用php连接sql server


How to connect with sql server using php in xampp

我的计算机中安装了xampp,xampp php版本为5.5.15。我想连接sql server(它也安装在我的计算机sql server 2005中)。我下载php驱动程序,并将两个php文件"php_pdo_sqlsrv_55_ts.dll"answers"php_sqlsrv _55_ts.dll"复制粘贴到"C:''xamp''php''ext"文件夹中,并将php.ini文件扩展名设置为php_pdo_sqlsrv-55_ts.dll和扩展名="php_sqlsrv_55_ts.dll"我的问题是,当我重新启动apache服务器时(从xampp控制面板),它会显示两条错误消息,一条是

httpd.exe错误"您的计算机中缺少http.exe错误msvcp110.dll"另一个是"examplep错误php启动无法加载动态库找不到特定模块"除了这个错误之外,我正试图使用代码连接sql server,但代码返回了未定义的sqlsrv_connect函数错误

我的代码是简单的

<?php
$serverName='SANTUNU23-PC'SQLEXPRESS';
$connectioninfo=array ('Database'=>'DB2662_cslBeseElec');
$myuser='santunu23';
$conn=sqlsrv_connect($serverName,$connectioninfo);
if($conn)
{
echo 'connection established';
}
else
{
echo 'can not make the connection'; 
die(print_r(sqlsrv_errors(),TRUE));
}
?>

现在该怎么办?任何建议我的系统是windows 7 32位

你本可以在谷歌上搜索"msvcp110.dll",然后你就会知道这个文件属于"Microsoft Visual C++2012 Redistributable Package"。所以下载它,安装它,再试一次。