我试过Sql服务器使用Wamp Server连接到Php

时间:2017-10-03 06:53:32

标签: php sql-server database

我试过Sql server Ms Ms使用Wamp Server提供

连接到Php
  

致命错误:调用未定义的函数sqlsrv_connect()   第4行的C:\ wamp \ www \ Project \ Demo.php

MS SQL服务器连接到PHP使用Wamp Server,我已按照以下步骤操作:

My System Windows 7 64-bit
installed Wamp Server 64-bit
SQLSRV32.EXE installed in C:\wamp\bin\php\php5.6.31\ext

wamp server PHP.ini文件提供扩展名

extension=php_sqlsrv_56_nts.dll
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_nts.dll

Demo.php

<?php
$serverName = "ZALA-PC\EURASIAN";
$connectionInfo = array("Database" => "Demo", "UID"=>"sa" , "PWD"=>"stcare@1");
$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));
}
?>

enter image description here

0 个答案:

没有答案