1. Download the Microsoft Drivers for PHP for SQL Server expansion pack
. (I am using version 2.0)
This expansion pack has requirements for the computer’s operating system, and the corresponding system uses the corresponding version.
3.0
Windows Server 2008 R2 SP1
Windows Vista SP2
Windows Server 2008 SP2
Windows 7 SP1
2.0 Supported operating systems
Windows Server 2003 Service Pack 1
Windows XP Service Pack 3
Windows Vista Service Pack 1 or later
Windows Server 2008
Windows Server 2008 R2
Windows 7
So this example uses the php_sqlsrv_53_ts_vc9.dll extension in 2.0
2. Copy the php_sqlsrv_53_ts_vc9.dll file to php Expand folder (generally under the
php/ext folder);
3. Copy this php_sqlsrv_53_ts_vc9.dll file to system32 on the system disk;
4. Open the php.ini file and set extension=php_mysql.dll Add the following line
extension=php_sqlsrv_53_ts_vc9.dll
5. Install the driver X86 Package (sqlncli.msi)
If you are connecting to sql2005, install sqlncli2005
If you are connecting to sql2008, install it sqlncli2008
If you are connecting to sql2015, install sqlncli2015
6 .Restart apache
The above introduces the method of connecting php to sqlserver, including sqlserver content. I hope it will be helpful to friends who are interested in PHP tutorials.