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