Pages

Wednesday, May 11, 2011

Installing phpmssql driver on windows

Below is the System configuration I installed SQL Driver 1.1 for PHP
Windows XP Service Pack3
PHP 5.2.13
SQL Server 2005
MS SQL Server Driver for PHP Ver 1.1( Download the SQL Server Driver for PHP)

Loading the SQL Server 2005 Driver for PHP is similar to loading any PHP extension:

1. Put the extension file (php_sqlsrv.dll or php_sqlsrv_ts.dll) in the PHP extension directory. If you are running the non-thread-safe version of PHP (php5.2dll), you should use the non-thread-safe version of the driver (php_sqlsrv.dll). Similarly, if you are running the thread-safe version of PHP (php5ts.dll), you should use the thread-safe version of the driver (php_sqlsrv_ts.dll).

Please note that In Sql driver version 1.1 you cant find the driver files (php_sqlsrv.dll or php_sqlsrv_ts.dll)

You will find driver files by name php_sqlsrv_52_nts_vc6.dll , php_sqlsrv_53_nts_vc9.dll etc

Copy these files into the extension folder of PHP

2. Modify the php.ini file to include the extension.

Depending on which version of the driver you want to load (non-thread-safe or thread-safe), you will need to add one of the following lines to the Dynamic Extensions section of your php.ini file:

extension=php_sqlsrv.dll (old version )

[extension=php_sqlsrv_52_ts_vc6.dll]
See Figure 1 below for more detail.

3. Restart the Web server.
Run the phpinfo (http://localhost/phpinfo.php)


If you don't see the sqlsrv information means that extension is not loaded .
I installed this driver on IIS with FastCGI configuration
Using FastCGI to Host PHP Applications on IIS 6.0