Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mani786's avatar

Uncaught Error: Call to undefined function sqlsrv_connect()

php.ini

extension=php_pdo_sqlsrv_80_ts_x64.dll
extension=php_sqlsrv_80_ts_x64.dll
extension=php_pdo_sqlsrv_74_ts_x64.dll
extension=php_sqlsrv_74_ts_x64.dll
<?php
$serverName = "DESKTOP-N0Q0IVO";
    $connectionInfo = array( "Database"=>"rishtay", "UID"=>"sa", "PWD"=>"********");
    $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));
?>

still getting the error Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\xampp1\htdocs\rishtay\index.php:13 Stack trace: #0 {main} thrown in C:\xampp1\htdocs\rishtay\index.php on line 13

0 likes
3 replies

Please or to participate in this conversation.