There are the ways that I used to connect PHP to SQL Server 2008 from zero to finish:
I. SQL Server 2008: Must have user login & password, use SQL Server Authentication mode.
1. First, plase connect your database by Windows Authentication. My server name that I used is: .\SQLEXPRESS
2. Select Security folder -> Logins -> New Login
3. Setting at General tab:
Fill in the Login Name that you want, use SQL Server authentication mode, give the password!
4. At Status tab, make sure the Permissions to the connect database engine = Grant, and Log = Enable.
And for the other tabs / option (Server Roles, User Mapping, Securables) could be tailored as you want. After that click OK!
5. Next, right click on the servers. \ SQLEXPRESS, click properties:
6. At Security tab, select Server authenctication become SQL Server and Windows Authentication mode.
7. Next setting, right click at the .\SQLEXPRESS server, select Facets
8. On dropdown-list Facet, select Server Configuration, change RemoteDacEnables become True
9. Also at Facet: Surface Area Configuration, select RemoteDacEnables become True too. Click OK !
10. Until this stage, the SQL Server configuration is complete. Prove to login using your username and password that was configured earlier. Disconnect, then connects again!
SUCCSESS . . !!
II. PHP Configuration (XAMPP 1.7.3)
1. Before performing the configuration, make sure the apache server is not in “start” condition, a.k.a turn off!
2. Download the latest version of ntwdblib.dll file (search on google), then copy to: XAMPP / Apache / bin, replace!
3. Open the php.ini file in the folder: / xampp / php / php.ini (also can be opened on notepad),
Remove the semicolon (;) before extension = php_mssql.dll, this means php_mssql.dll extension enabled.
4. Now you can re-enabled Apache server.
III. Connection Testing
Type the following in a text editor, this example is my case. Customize your Server Name, User Login, and Password as you setup earlier.
After the execution, should see the message “DB connection successful”.
GOOD LUCK ^ _ ^