PHP installation sqlsrv extension steps, PHP How to connect on SQL

Source: Internet
Author: User
Tags sql server driver mssql support microsoft

Today, a day, finally the PHP sqlsrc extension to fix. In order for PHP to successfully connect to the MSSQL, it is not easy.

First step: Install Wampserver

I installed the Wampserver 2.4.17 version. Note: Install Wampserver before installing Microsoft's Vcredist_x64.exe, my operating system is 64-bit, the specific operation of the system several according to the provisions of the installation;

Step Two: Install related components and download related extensions

Extract the DLL files from the SQL Server Driver for PHP Extension Pack (unofficial) into the Bin\php\ext folder

Need to pay attention to is unofficial DLL file, otherwise after installation or not, I also do not understand why the official cannot. After I completed the steps below, I specifically tried to overwrite the official Microsoft Sqlsrv extension package, or failed to open the sqlsrv extension.

Step three: Modify the relevant configuration in Wamp (Local machine/server) Select one

Local machine:

Open the Wamp\bin\php folder to locate the php.ini file, open the following two extensions;

Extension=php_pdo_sqlsrv_56_ts.dll
Extension=php_sqlsrv_56_ts.dll

Server: In fact, there is one more.

Open the Wamp\bin\php folder to locate the php.ini file, open the following two extensions;

Extension=php_pdo_sqlsrv_56_ts.dll 56 represents the PHP version
Extension=php_sqlsrv_56_ts.dll

Open Wamp\bin\apache\apache2.4.6\bin\php.ini, open Add the following two extensions:

Extension=php_pdo_sqlsrv_56_ts.dll
Extension=php_sqlsrv_56_ts.dll

Restart Apache after last save PHP.ini

Fourth Step: Install the driver

Install the Microsoft SQL Server Native client.msi driver on the server where PHP is located

Note: There are 32-bit and 64-bit drivers in the Microsoft SQL Server Native client.msi Driver

Fifth step: Install ODBC Driver one for SQL "Msodbcsql.msi"

Digression: I heard that PHP does not support Microsoft's SQL Server 2008. Then Microsoft made an interface for PHP to support MSSQL. But why do you have to do this to Microsoft?

Today I've been tinkering with the day, installing so much just to add sqlsrv extensions. Microsoft is poisonous.

PHP installation sqlsrv extension steps, PHP How to connect on SQL

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.