Solved

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

Posted on 2012-04-12
5
867 Views
Last Modified: 2012-04-15
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!
0
Comment
Question by:lthames
5 Comments
 
LVL 1

Expert Comment

by:chrisroch
ID: 37837760
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).
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 37837802
Just a thought... Have you read the user-contributed notes here?  Some might be helpful.  I've also found HostGator telephone support to be excellent.
http://us3.php.net/manual/en/function.mssql-connect.php
0
 

Author Comment

by:lthames
ID: 37837820
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.
0
 

Author Comment

by:lthames
ID: 37837823
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!
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37847836
In this question http://www.experts-exchange.com/Programming/Languages/C/Q_27424576.html , the asker finally figured out how to configure freeTDS and make it work on Linux to connect to Microsoft SQL.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now