Solved

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

Posted on 2012-04-12
5
876 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 109

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 83

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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