PHP connection to Microsoft SQL Server

We have a SLES 11 sp2 web server that we need to connect to a SQL Server 2005 database. We are running PHP 5.3. From our research there are two ways we could connect to SQL Server 2005 with php5.3; odbc_connect or mssql_connect, but we have not had any success doing this with either. For the ODBC option we can get php5-odbc installed, but are not able to find a driver compatible with SLES 11. The php5-mssql option does not appear in YAST.

What is the best way to connect to SQL Server 2005 with SLES 11 sp2?

Hi hydepark,

while I can give you no help at all with the MSSQL server question, I had a look at what pear might say about mssql:

[CODE]# pear search mssql
Retrieving data…0%
Matched packages, channel pear.php.net:

Package Stable/(Latest) Local
MDB2_Driver_mssql 1.5.0b4 (beta) mssql MDB2 driver[/CODE]

(this is from a SLES11SP2 install)

So “pear install mdb2_driver_mssql” might be an option for you.

Regards,
Jens

Hi hydepark,

ignore my comment pointing you to the pear package… that will need the mssql extension to install :wink:

But maybe “pecl” could be of help…

[CODE]# pecl search sqlsrv
Retrieving data…0%
.Matched packages, channel pecl.php.net:

Package Stable/(Latest) Local
pdo_sqlsrv 3.0.1 (stable) Microsoft Drivers for PHP for SQL Server (PDO_SQLSRV)
sqlsrv 3.0.1 (stable) Microsoft Drivers for PHP for SQL Server (SQLSRV)[/CODE]

I don’t know what it will require to compile, though.

Regards,
Jens

We will take a look at this. Thanks.