search
HomeBackend DevelopmentPHP7What is the method to connect sqlserver in php7

This article introduces how to connect php7 to Sqlserver. It mainly includes usage examples of php7.2 connecting to Sqlserver, application skills, summary of basic knowledge points and matters needing attention. It has certain reference value and friends in need can refer to it.

What is the method to connect sqlserver in php7

First of all, php needs to enable the sqlsrv extension

1. Download SQLSRV40.EXE (supports php7.0), https:// www.microsoft.com/en-us/download/details.aspx?id=20098

##2. Run SQLSRV40.EXE, Generate extension files, as shown in the figure

3. Copy php_pdo_sqlsrv_7_ts_x64.dll and php_sqlsrv_7_ts_x64.dll to the php/ext directory (my computer is 64-bit)

Note: For the difference between ts and nts, see phpinfo

4. Add

extension=php_pdo_sqlsrv_7_ts_x64.dll

to php.ini

extension=php_sqlsrv_7_ts_x64.dll

Open extension

##5. Install ODBC Driver 11 For SQL (msodbcsql.msi)

https://www.microsoft.com/en-us/download/details.aspx?id=36434

6. Run msodbcsql.msi to complete the installation

Note:

7. Restart apache, the sqlsrv extension is successfully opened

Note: The php7.1 version will not be successfully opened according to this method, the reason The two extension files php_pdo_sqlsrv_7_ts_x64.dll and php_sqlsrv_7_ts_x64.dll are not applicable to php7.1. Please search for these two extension files suitable for php7.1

Recommended learning:

php video tutorial

The above is the detailed content of What is the method to connect sqlserver in php7. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use