Cannot Call function sqlsrv_connect()

前端 未结 3 561
死守一世寂寞
死守一世寂寞 2020-12-04 02:40

I went through several questions and recommendation to resolve the above issue, but No luck at all.

I have the following settings:

Windows Server

相关标签:
3条回答
  • 2020-12-04 02:51

    I have struggled through the process and this is what has finally worked. I am using php 5.4.16 and Apache 2.4.4 with Sql Express 2008 R2.

    1. Download Microsoft Drivers for PHP for SQL Server from Microsoft download site

    2. Extact the files to a local folder

    3. Copy php_sqlsrv_54_ts.dll and php_pdo_sqlsrv_54_ts.dll to the Ext folder (C:\wamp\bin\php\php5.4.16\ext). You can confirm the folder by checking the value of extension_dir in php.ini file stored under Apache (C:\wamp\bin\apache\Apache2.4.4\bin).
    4. Add extension for the two drivers by adding these lines: extension=php_sqlsrv_54_ts.dll extension=php_pdo_sqlsrv_54_ts.dll and comment out the existing lines below if not commented: ;extension=php_pdo_mssql.dll ;extension=php_mssql.dll
    5. Start all Wamp services
    0 讨论(0)
  • 2020-12-04 02:55

    What worked for me on windows 10 64bit and php 5.6. is the 3.2 version of the driver downloaded from here:Microsoft SQL Server driver for PHP

    0 讨论(0)
  • 2020-12-04 02:56

    Load the PHP drivers in php.ini file and restart the server.

    extension=php_sqlsrv_53_ts.dll
    extension=php_pdo_sqlsrv_53_ts.dll
    

    Reference: http://technet.microsoft.com/en-us/library/cc296203(v=sql.105).aspx

    TS denotes thread safe. find your server is thread safe or non thread safe

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