PDA

View Full Version : PHP connection to Microsoft SQL Server



hydepark
14-Mar-2013, 23:53
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?

jmozdzen
15-Mar-2013, 16:12
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:


# 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

(this is from a SLES11SP2 install)

So "pear install mdb2_driver_mssql" might be an option for you.

Regards,
Jens

jmozdzen
15-Mar-2013, 16:22
Hi hydepark,

ignore my comment pointing you to the pear package... that will need the mssql extension to install ;)

But maybe "pecl" could be of help...

# 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)

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

Regards,
Jens

hydepark
15-Mar-2013, 21:36
We will take a look at this. Thanks.