未定义的函数sqlsrv_connect() - Apache2.4

时间:2016-08-03 18:05:17

标签: php

  

致命错误:未捕获错误:在C:\ Apache24 \ htdocs \ SQLI \ SQL_CON.php中调用未定义函数sqlsrv_connect():4堆栈跟踪:#0 {main}抛出C:\ Apache24 \ htdocs \ SQLI \第4行的SQL_CON.php **

我已将此添加到php.ini文件中:

extension=php_pdo_sqlsrv_53_ts.dll

extension=php_sqlsrv_53_ts.dll

我的简单代码是:

<?php
$servername="JOSEPHP-JOSEPHP\SQLEXPRESS";
$connectionInfo = array( "Database"=>"AdventureWorks2014");
$con = sqlsrv_connect($servername, $connectionInfo);
if($con) {
    die ("Connect is ok: ".connect_error);
}
else {

    echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}

?>

我该如何解决这个问题?

0 个答案:

没有答案