Link to home
Start Free TrialLog in
Avatar of Lynn Thames
Lynn ThamesFlag for United States of America

asked on

Help with error trying to connect to SQL Server 2008 from linux with php sql server extensions

Help!

I have a new app that we are trying to test on our dedicated linux webserver (hosted at hostgator).  The app is using php ms sql server extensions that were installed by Hostgator.

We get the following error trying to run the scripts from the hostgator web server, but it works fine running locally.

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: xx.xxx.xxx.xxx,xxxxx in /home/sp/public_html/formdemo/101forms.ajax.php on line 11
array(4) { ["type"]=> int(2) ["message"]=> string(128) "mssql_connect() [function.mssql-connect]: Unable to connect to server: xx.xxx.xxx.xxx,xxxxx" ["file"]=> string(47) "/home/sp/public_html/formdemo/101forms.ajax.php" ["line"]=> int(11) } connection failed

Can anyone help me troubleshoot this?

Thanks!
Avatar of chrisroch
chrisroch

Find out if the mssql server allows for external connections. It seems like the mssql server is blocking the requests from your web server. It could be a firewall issue, where you need to open the port on which the database server listens (even through that could be a security risk).
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lynn Thames

ASKER

The ms sql server already works with external connections on a different database (same sql server instance . . .sqlexpress).  But these are VB applications run from remote desktops.  And they work from any IP address anywhere.

And the port is opened on the router firewall.
Ray,  I have a programmer working through that very document already.  Hostgator provided it to us.

And I have also found hostgator support to be great . . . but in this case the rep I was working with is as lost as I am!

So I am hoping to find an expert that can either pave the way or knows the solution!
Avatar of Dave Baldwin
In this question https://www.experts-exchange.com/questions/27424576/Looking-for-examples-on-connecting-to-MS-SQL-Server-with-freetds-in-C.html , the asker finally figured out how to configure freeTDS and make it work on Linux to connect to Microsoft SQL.