Cannot Call function sqlsrv_connect()

前端 未结 3 573
死守一世寂寞
死守一世寂寞 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

提交回复
热议问题