致命错误:调用未定义函数sqlsrv_connect()php版本7.2.8

时间:2018-10-13 21:41:13

标签: php sql-server

我正努力解决此问题,但我不能。我下载了php 7.2.8的驱动程序,并将其放在php/ext文件夹中,并在php.ini中定义了它

extension=php_sqlsrv_72_ts.dll
extension=php_pdo_sqlsrv_72_nts.dll
extension=php_sqlsrv_72_nts.dll
extension=php_pdo_sqlsrv_72_ts.dll

,它仍然无法正常工作。我的代码是

<?php
    $serverName = "DESKTOP-DA3ICN8\ELMASRY"; //serverName\instanceName

    // Since UID and PWD are not specified in the $connectionInfo array,
    // The connection will be attempted using Windows Authentication.
    $connectionInfo = array( "database'=>'elmasry");
    $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));
    }
?>

0 个答案:

没有答案