简体   繁体   English

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

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

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, 我已经尝试安装SQLSRV30并配置为家庭教师,但还是没有运气,
  • I also tried copy this ntwdblib.dll (version 2000.80.194.0) to directories php5.3.5/ext and still no luck. 我还尝试将ntwdblib.dll(版本2000.80.194.0)复制到目录php5.3.5 / ext,仍然没有运气。

kindly help me. 请帮助我。

According to here 根据这里

These functions allow you to access MS SQL Server database. 这些功能使您可以访问MS SQL Server数据库。 This extension is not available anymore on Windows with PHP 5.3 or later. 在具有PHP 5.3或更高版本的Windows上,此扩展名不再可用。 SQLSRV, an alternative driver for MS SQL is available from Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx . 可以从Microsoft获得SQLSRV,它是MS SQL的替代驱动程序:» http://msdn.microsoft.com/zh-cn/sqlserver/ff657782.aspx

First download SQLSRV20.EXE from here Put 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. 重新启动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());
}

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

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