[英]This extension requires the Microsoft ODBC Driver 11 for SQL Server in PHP
I am trying to run a PHP develop application on my PC with MSSQL and this is the first time I am doing . 我正在尝试使用MSSQL在PC上运行PHP开发应用程序,这是我第一次这样做。 I have already configured XAMPP on my PC and started Apache 我已经在PC上配置了XAMPP并启动了Apache
Steps I did: 我执行的步骤:
Downloaded sqlsrv32.exe 下载的sqlsrv32.exe
As my Php is 因为我的PHP是
PHP Version 5.6.20 PHP版本5.6.20
So i copied 所以我复制了
extension=php_sqlsrv_56_ts.dll and 扩展名= php_sqlsrv_56_ts.dll和
extension=php_pdo_sqlsrv_56_ts.dll 扩展名= php_pdo_sqlsrv_56_ts.dll
to my ext folder I have checked php.ini my extension folder is extension_dir="C:\\xampp\\php\\ext" 到我的ext文件夹中,我已经检查了php.ini,我的扩展文件夹是extension_dir =“ C:\\ xampp \\ php \\ ext”
Also on phpinfo() i have 在phpinfo()上我也有
sqlsrv support enabled 启用sqlsrv支持
Directive Local Value Master Value 指令地方价值主价值
sqlsrv.ClientBufferMaxKBSize 10240 10240 sqlsrv.ClientBufferMaxKBSize 10240 10240
sqlsrv.LogSeverity 0 0 sqlsrv.LogSeverity 0 0
sqlsrv.LogSubsystems 0 0 sqlsrv.LogSubsystems 0 0
sqlsrv.WarningsReturnAsErrors On On sqlsrv.WarningsReturnAsErrors开开
Which meand its already installed, and my database.php file i have following code: 这意味着它已经安装了,我的database.php文件具有以下代码:
$serverName = "KASHIF\\SQLEXPRESS"; //serverName\instanceName
$connectionInfo = array( "Database"=>"RMS Delivery");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
However when I open my application on browser it says : 但是,当我在浏览器中打开应用程序时,它显示:
Connection could not be established. 无法建立连接。 Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) ) 数组([0] =>数组([0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] =>此扩展要求Microsoft SQL的Microsoft ODBC驱动程序11服务器访问以下URL,以下载用于x86的SQL Server的ODBC驱动程序11: http : //go.microsoft.com/fwlink/?LinkId = 163712 [message] =>此扩展名需要用于SQL Server的Microsoft ODBC驱动程序11 。访问以下URL,以下载用于x86的SQL Server的ODBC驱动程序11: http : //go.microsoft.com/fwlink/?LinkId =163712)[1] =>数组([0] => IM002 [SQLSTATE] => IM002 [1] => 0 [代码] => 0 [2] => [Microsoft] [ODBC驱动程序管理器]找不到数据源名称且未指定默认驱动程序[消息] => [Microsoft] [ODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序))
Then I downloaded ODBC Driver 11 for SQL Server , while installing it says : 然后我下载了用于SQL Server的ODBC Driver 11,安装时说:
Installation of this product failed because it is not supported on this oeprating system. 由于该操作系统不支持该产品,因此安装失败。
I already have SQL SERVER 2012 with Management Studio on my pc. 我的电脑上已经安装了带有Management Studio的SQL SERVER 2012。
So please advice what I am leaving or what i am doing wrong . 因此,请告知我要离开的地方或我做错了什么。
Thanks 谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.