PHP7 add SQL Server Extensions under Windows platform

Source: Internet
Author: User
Tags microsoft drivers for php for sql server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.