Login to Members Area

Choose the service you want to log in
24x7x365 Presence
Live Chat

Hosting Blog


Connecting PHP with the MSSQL database on IIS7

Sometimes we have to connect PHP with MSSQL - most of the webhosts don't offer this on a shared environment but it is possible to have this facility on a dedicated server or VPS with the following steps:-

Step 1: Make sure that you're running the IIS web server with PHP installed on it.

Step 2: Download Microsoft Drivers 3.0 for PHP and the SQL Server on your server and run the file:-


Step 3: When prompted, enter the path to the PHP extensions directory - it's recommended by Microsoft to use 'C:\Program Files'

Step 4: After extracting the files, copy the dlls from the extracted directory

(For non-thread safe)

(For thread safe)

to the PHP extensions directory which could be like C:\PHP\ext\ or 'C:\Program Files x86\PHP\ext\' on the server.

Note: Read the Installation section of the SQLSRV30_Readme.htm file for more details.

Step 5: Install the Microsoft SQL Server native client as per your MSSQL edition - 2005 or 2008 or 2012.

Step 6: Enable the sqlsrv extension in the php.ini configuration file of the server, as below:-


Step 7: Then restart the web service or IISRESTART on the server, and then check the phpinfo page and you should be seeing that the sqlsrv section is now being displayed on that page which means that you are now able to connect with the MSSQL database using PHP code.

That's all.

Sachin Sunday 23 February 2014 - 06:35 am | | Default

No comments

(optional field)
(optional field)

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.