1, 7.0.x
Extensions for 7.0.x:
Microsoft Drivers for PHP for SQL Server https://www.microsoft.com/en-us/download/details.aspx?id=20098
ODBC Driver:
MICROSOFT®ODBC Driver each for SQL server®-Windows (supports SQL server®2005) https://www.microsoft.com/zh-CN/download/details . aspx?id=36434
MICROSOFT®ODBC Driver for SQL server®-Windows + Linux (support for the latest SQL server®2016) https://www.microsoft.com/zh-CN/downl oad/details.aspx?id=50420
Installation configuration:
Download SQL Server PHP extension (Microsoft Drivers for PHP for SQL Server), there are multiple files in the connection, only need to download SQLSRV40. EXE can.
After decompression, choose 32-bit or 64-bit extensions according to your PHP version, and note the distinction (Thread safe?). ) NTS and TS.
Copy the extension required files to the PHP extension directory. (For example I am using: Php_pdo_sqlsrv_7_ts_x64.dll and Php_sqlsrv_7_ts_x64.dll)
Modify PHP.ini Add the following two lines to enable the extension:
extension=php_sqlsrv_7_ts_x64.dllextension=php_pdo_sqlsrv_7_ts_x64.dll
Install ODBC Driver and select the address above to download and install it according to your needs.
You can now use Phpinfo () to see if the Pdo_sqlsrv module was successfully loaded.
2, PHP 7.1.x
PHP 7.1.x is not configured as described above because the 4.0 version of Microsoft Drivers for PHP is supported only to PHP7.0.
Extensions for PHP 7.1.x are going to GitHub to download the 4.1.3 version of the ability to use.
4.1.3-windows-preview https://github.com/Microsoft/msphpsql/releases/tag/v4.1.3-Windows
Configuration method with 7.0.x, is still a preview version.
PHP7 add SQL Server Extensions under Windows platform