PHP on IIS7 with (PDO) MS-SQL support

前端 未结 2 1918
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 08:07

I\'m running an IIS 7 windows server and a relevant part of my phpinfo\'s configure command currently reports this:

cscript /nologo configure.js .....

相关标签:
2条回答
  • 2020-12-11 08:24

    You can solve this problem using PHP Manager in IIS 7.0 Goto PHP Manager ->PHP Extensions->Enable of Disable Extensions ->Disable List Enable your PHP_PDO_SQLSRV_54_ts.dll

    will work prefecttly

    0 讨论(0)
  • 2020-12-11 08:38

    Microsoft SQL Server support and extensions are not shipped with PHP anymore. To connect PHP with SQL Server you need Microsoft Drivers for PHP for SQL Server:

    The Microsoft Drivers for PHP for SQL Server is a PHP 5 extension that provides data access to SQL Server 2005 and later versions including SQL Azure.

    The download page for drivers lists four versions to choose from. Consult the System Requirements page in order to determine which version you need. You must install the correct driver for your Operating System+SQL Server+PHP version combination.

    You will also need one of these depending on which driver you choose (these must be installed separately):

    • SQL Server Native Client
    • Microsoft ODBC Driver 11 for SQL Server

    The installer simply extracts the files in the specified location. You must the files to PHP extensions directory. The files are PHP extensions. The file names indicate:

    • nts/ts -- should be used with non thread safe/thread safe version of PHP
    • 54/55/56... -- should be used with PHP version 5.4, 5.5, 5.6, ...
    • sqlsrv/pdo_sqlsrv -- provides procedural interface/PDO interface

    Enable the extensions in php.ini file making sure that thread safetyness and PHP versions match.

    Check phpinfo to see if extensions are loaded. Test sqlsrv_connect("servername") and new PDO("sqlsrv:server=servername") to make sure the extensions are working.

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