简体   繁体   English

如何在Xampp中使用php与SQL Server连接

[英]How to connect with sql server using php in xampp

I have xampp install in my computer and xampp php version is 5.5.15 i want to connect with a sql server (which is also install in my computer sql server 2005) i download php driver and copy paste two php file "php_pdo_sqlsrv_55_ts.dll" and "php_sqlsrv_55_ts.dll" in "C:\\xampp\\php\\ext" folder and format php.ini file extension=php_pdo_sqlsrv_55_ts.dll and extension="php_sqlsrv_55_ts.dll" my problem is when i am restart the apache server (from xampp control panel) it's display two error message one is 我在计算机上安装了xampp,xampp的php版本是5.5.15,我想连接一个sql服务器(也在我的计算机sql server 2005中安装),我下载了php驱动程序并复制粘贴了两个php文件“ php_pdo_sqlsrv_55_ts.dll”和“ C:\\ xampp \\ php \\ ext”文件夹中的“ php_sqlsrv_55_ts.dll”并格式化php.ini文件扩展名= php_pdo_sqlsrv_55_ts.dll和extension =“ php_sqlsrv_55_ts.dll”,我的问题是当我重新启动apache服务器时(从xampp重新启动)控制面板),它显示两个错误消息,一个是

httpd.exe error "http.exe error msvcp110.dll is missing from your computer" another one is "xampp error php startup unable to load dynamic library the specific module could not be found" beside this error i am trying to connect with sql server using code but the code return with undefined sqlsrv_connect function error httpd.exe错误“您的计算机上缺少http.exe错误msvcp110.dll”,另一个错误是“ xampp错误php启动无法加载动态库,找不到特定模块”,此错误在我尝试与sql server连接时使用代码,但代码返回并带有未定义的sqlsrv_connect函数错误

My code is simple 我的代码很简单

<?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));
}
?>

What to do now?any suggestion My system is windows 7 32bit 现在该怎么办?有什么建议我的系统是Windows 7 32bit

You could've googled "msvcp110.dll", then you would know that this file belongs to the "Microsoft Visual C++ 2012 Redistributable Package". 您可能已经在“ msvcp110.dll”上进行了搜索,然后知道该文件属于“ Microsoft Visual C ++ 2012可再发行组件包”。 So download it, install it, try it again. 因此,请下载,安装并重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM