Fatal error: Call to undefined function mssql_connect() or sqlsrv_connect() in xampp

后端 未结 1 1452
梦毁少年i
梦毁少年i 2020-12-07 04:49

I did all the changes given here but I still not connect SQL server on my php 5.6 version.

I tried with mssql_connect() and sqlsrv_connect()

相关标签:
1条回答
  • 2020-12-07 05:10

    mssql_connect() is no longer supported by PHP since PHP 7.0 and was depreciated in 5.3.

    Create a phpinfo.php file:

    <?php
    
    // Show all information, defaults to INFO_ALL
    phpinfo();
    
    ?>
    

    Open the page, and on the first page that's opened, third from the bottom, check if the registered streams contains 'sqlsrv':

    Registered PHP Streams  php, file, glob, data, http, ftp, zip, compress.zlib, phar, sqlsrv
    

    If it doesn't then you have to enable the module. Try uncomment this code that you changed: From:

    ; On windows: extension_dir = "D:\xampp\php\ext" "
    

    To:

    On windows: extension_dir = "D:\xampp\php\ext"
    

    And let us know the outcome.

    0 讨论(0)
提交回复
热议问题