php wamp php5.3.5 mssql_connect() 致命错误:调用未定义的函数 mssql_connect()

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11029626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 23:37:01  来源:igfitidea点击:

wamp php5.3.5 mssql_connect() Fatal error: Call to undefined function mssql_connect()

phpsql-server

提问by Meas

I am using WampServer Version 2.1, php5.3.5 , Apeache2.2.17 I could not use mssql_connect(), "mssql_connect() Fatal error: Call to undefined function mssql_connect()" I went through googling but still not found solution.

我正在使用 WampServer 版本 2.1、php5.3.5、Apeache2.2.17 我无法使用 mssql_connect()、“mssql_connect() 致命错误:调用未定义的函数 mssql_connect()”我通过谷歌搜索但仍然没有找到解决方案。

  • I have tried install SQLSRV30 and configure as tutor but still no luck,
  • I also tried copy this ntwdblib.dll (version 2000.80.194.0) to directories php5.3.5/ext and still no luck.
  • 我尝试安装 SQLSRV30 并配置为导师,但仍然没有运气,
  • 我还尝试将此 ntwdblib.dll(版本 2000.80.194.0)复制到目录 php5.3.5/ext 中,但仍然没有运气。

kindly help me.

请帮助我。

回答by Musa

According to here

根据这里

These functions allow you to access MS SQL Server database. This extension is not available anymore on Windows with PHP 5.3 or later. SQLSRV, an alternative driver for MS SQL is available from Microsoft: ? http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.

这些函数允许您访问 MS SQL Server 数据库。此扩展在使用 PHP 5.3 或更高版本的 Windows 上不再可用。SQLSRV,Microsoft 提供的 MS SQL 替代驱动程序: ? http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

回答by papkass

First download SQLSRV20.EXE from herePut the file "php_sqlsrv_53_ts_vc9.dll" in your "wamp\php\ext" folder.

首先从这里下载 SQLSRV20.EXE 将文件“php_sqlsrv_53_ts_vc9.dll”放在你的“wamp\php\ext”文件夹中。

In php.ini add this line: extension=php_sqlsrv_53_ts_vc9.dll

在 php.ini 添加这一行:extension=php_sqlsrv_53_ts_vc9.dll

Restart apache.

重启阿帕奇。

Then you should be able to connect with:

然后你应该能够连接到:

$connectionInfo = array( "Database" => "dbname", "UID" => "username", "PWD" => "password", "CharacterSet" => "UTF-8");
$con = sqlsrv_connect("ipaddress", $connectionInfo);
if( $con === false )
{
  die('Not working: ' . sqlsrv_errors());
}

回答by Evan Oswald