简体   繁体   English

此扩展需要PHP中用于SQL Server的Microsoft ODBC Driver 11

[英]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 谢谢

You can download pdo driver from here . 您可以从此处下载pdo驱动程序。

You will get all driver and help file too which is enough to solve your all query. 您还将获得所有驱动程序和帮助文件,足以解决您的所有查询。 I use php_pdo_sqlsrv_56_ts.dll driver for to my localhost. 我将php_pdo_sqlsrv_56_ts.dll驱动程序用于本地主机。

暂无
暂无

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

相关问题 此扩展需要 Microsoft ODBC Driver 11 for SQL Server 才能与 SQL Server 通信 - This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server 此扩展需要 Microsoft ODBC Driver 13 for SQL Server 才能与 SQL Server 通信 - This extension requires the Microsoft ODBC Driver 13 for SQL Server to communicate with SQL Server PHP PDO Microsoft SQL Server:SQLSTATE [24000]:[Microsoft] [用于SQL Server的ODBC驱动程序11]-无效的游标状态 - PHP PDO Microsoft SQL Server: SQLSTATE[24000]: [Microsoft][ODBC Driver 11 For SQL Sever] - Invalid Cursor State 如何使用PHP在RedHat Linux上为SQLServer®配置Microsoft®ODBC驱动程序11 - How to Configure Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP 使SQL Server的ODBC Driver 11适用于Azure网站中的PHP - Making ODBC Driver 11 for SQL Server Available For PHP In Azure Website 为 Microsoft SQL 服务器安装 ODBC 驱动程序和 php 驱动程序 ZA5C95B86291EA2709FCBE64458ED 服务器 - Install ODBC driver and php drivers for Microsoft SQL Server for Laravel Sail 带PHP的RedHat Linux上用于SQLServer®的Microsoft®ODBC驱动程序11-与PDO的存储过程绑定参数时出现错误 - Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP - gives an error when bind parameter with PDO for stored procedures Microsoft SQL Server驱动程序的odbc连接字符串 - odbc connection string for microsoft sql server driver SQLSTATE [HY000]:[Microsoft] [SQL Server的ODBC驱动程序11] TDS协议错误 - SQLSTATE[HY000]: [Microsoft][ODBC Driver 11 for SQL Server]TDS Protocol error 错误号:42000 [Microsoft] [用于SQL Server的ODBC驱动程序11] [SQL Server]必须指定要选择的表。 选择 * - Error Number: 42000 [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Must specify table to select from. SELECT *
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM