4 out of 9 rated this helpful - Rate this topic

System Requirements (Microsoft Drivers for PHP for SQL Server)

To access data in a SQL Server 2005 or later database using the Microsoft Drivers for PHP for SQL Server, you must have the following components installed on your computer:

  • A supported operating system, such as:

    • 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

  • PHP 5. For information about how to download and install the latest stable binaries, visit http://php.net.

    The Microsoft Drivers for PHP for SQL Server works with PHP 5.2.4 or later. If possible, use PHP 5.2.13, or later.

  • A version of the driver file must be in your PHP extension directory. See Driver Versions later in this topic for information about the different driver files. See Loading the Microsoft Drivers for PHP for SQL Server for information on configuring the driver for the PHP runtime.

    (See The Data Center for the Microsoft Drivers for PHP for SQL Server for information on where to download the Microsoft Drivers for PHP for SQL Server.)

  • A Web server. Your Web server must be configured to run PHP. For information about hosting PHP applications with Internet Information Services (IIS) 6.0, see Using FastCGI to Host PHP Applications on IIS 6.0. For information about hosting PHP applications with IIS 7.0, see Using FastCGI to Host PHP Applications on IIS 7.0.

    The Microsoft Drivers for PHP for SQL Server has been tested using IIS 6 and IIS 7 with FastCGI.

  • Microsoft SQL Server 2008 R2 Native Client installed on the same computer on which PHP is running.

    If you are using the SQLSRV driver, sqlsrv_client_info will return information about which version of SQL Server Native Client is being used by the Microsoft Drivers for PHP for SQL Server. If you are using the PDO_SQLSRV driver, you can use PDO::getAttribute to discover the version.

  • Microsoft SQL Server 2008 R2 Native Client is required to use Microsoft Drivers for PHP for SQL Server. (The x86 version of SQL Server Native Client will be installed with the X64 version of SQL Server Native Client.) To download and install SQL Server 2008 R2 Native Client now, click on the appropriate link below:

    Download the X86 package

    Download the X64 package

This section lists the drivers that are installed for version 1.1 and version 2.0 of the Microsoft Drivers for PHP for SQL Server.

Follow the installation instructions in Loading the Driver to configure the driver for use with the PHP runtime.

Version 1.1 of the Microsoft Drivers for PHP for SQL Server installs several versions of the driver:

Driver file

PHP version

Thread safe?

Use with PHP .dll

php_sqlsrv_53_nts_vc6.dll

5.3

no

php5.dll

php_sqlsrv_53_nts_vc9.dll

5.3

no

php5.dll

php_sqlsrv_53_ts_vc6.dll

5.3

yes

php5ts.dll

php_sqlsrv_53_ts_vc9.dll

5.3

yes

php5ts.dll

php_sqlsrv_52_nts_vc6.dll

5.2

no

php5.dll

php_sqlsrv_52_ts_vc6.dll

5.2

yes

php5ts.dll

If the name of the driver file contains "vc9", it should be used with a PHP version compiled with Visual C++ 9.0. If the name of the driver file contains "vc6", it should be used with a PHP version compiled with Visual C++ 6.0.

Version 2.0 of the Microsoft Drivers for PHP for SQL Server installs several versions of the driver:

Driver file

PHP version

Thread safe?

Use with PHP .dll

php_sqlsrv_53_nts_vc6.dll

php_pdo_sqlsrv_53_nts_vc6.dll

5.3

no

php5.dll

php_sqlsrv_53_nts_vc9.dll

php_pdo_sqlsrv_53_nts_vc9.dll

5.3

no

php5.dll

php_sqlsrv_53_ts_vc6.dll

php_pdo_sqlsrv_53_ts_vc6.dll

5.3

yes

php5ts.dll

php_sqlsrv_53_ts_vc9.dll

php_pdo_sqlsrv_53_ts_vc9.dll

5.3

yes

php5ts.dll

php_sqlsrv_52_nts_vc6.dll

php_pdo_sqlsrv_52_nts_vc6.dll

5.2

no

php5.dll

php_sqlsrv_52_ts_vc6.dll

php_pdo_sqlsrv_52_ts_vc6.dll

5.2

yes

php5ts.dll

If the name of the driver file contains "vc9", it should be used with a PHP version compiled with Visual C++ 9.0.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Is there a problem with your documentation?

You suggest to add this extension in your loading driver.
extension=php_sqlsrv_52_ts.dll

This found is not in the list on this page. Is this a documentation bug?
(see here: http://social.msdn.microsoft.com/Forums/en-US/sqldriverforphp/thread/887836a9-ed0c-47c2-9c4f-85f779f13649)

When do you plan to update the documentation?

What is the correct driver to use for PHP 5.2.13?

Even with the suggested php_sqlsrv_52_ts_vc6.dll I cannot connect.

where to get php_sqlsrv.dll?
i searched around a bit, but i could not find the dll files specified above? a link to the download would be great...

MSFT RESPONSE: Fair enough. Until the pages are fixed, here are the download links.
SQL Server Driver for PHP 1.1: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
SQL Server Driver for PHP 2.0 CTP: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=df4d9cc9-459c-4d75-a503-ae3fceb85860
Trouble on Windows Server 2003
Trouble passing through database views in case when runing on Windows Server 2003 (SP2) . No result, just number of rows
No problem on Windows XP (SP3)

[php_sqlsrv_53_ts_vc6.dll] [Apache 2.2.14] [PHP 5.3.1]

MSFT RESPONSE: If you are having problems, please use one of the options listed in the Support Resources page of the driver documentation.
Running MS SQL 2000 with php5.2.8

Hey there, is the SQL Server 2005 Driver for PHP backward compatible with MS SQL 2000?


I am trying to set up MS SQL database connection capability on a running php5.2.8 localhost platform on IIS 6.

Some guidance will surely be appreciated.

Thanks


MSFT RESPONSE: Yes, it should work. SQL Server 2000 is the oldest version supported by this driver. If you are having problems, please use one of the options listed in the Support Resources page of the driver documentation.

Why no *nix driver?
Do you want us to use your products or not...?