Question

The client I am currently working with is using php 5.2.14 with mssql 2012 on a linux box. I am trying to help get the developers a local development version setup so they can continue to support the existing site while getting things upgraded to handle modern PHP versions. The Linux version of php 5.2 seems to connect to the MSSQL server just fine. using mssql_connect. However on the windows machine where I am running version 5.2.9 the mssql_connect doesn't work. At this time I must keep the code as is and get something working on windows for the developers. So I can't use the new drivers by MSSQL that use sqlsrv_connect. Does anyone have any suggestions on what to do?

The error I get current looks like this...

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.221.223\DEVL in C:\projects\repo\volunteers\trunk\lib\class_mssql_db.php on line 115

The credentials that are being used are the same on this machine as they are on the linux box.

Was it helpful?

Solution

Okay so the solution was to find a dll of freeTDS for windows... the place I went was here... http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Windows

I disabled mssql and included that .dll and everything starting working fine. So that is the fix for anyone else who racks their brain on this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top