Skip to Content.
Sympa Menu

freetds - Re: [freetds] tds7_get_instance_port timed out

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Robert Gonzalez <robert AT robert-gonzalez.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] tds7_get_instance_port timed out
  • Date: Sat, 20 Mar 2010 07:24:06 -0700

The connection string might be confusing PHP. Where I work we connect to SQL
server from Ubuntu and have configured all of our connection names in our
FreeTDS conf file.

We have tried to connect to the servers like you have and have failed pretty
much the same way you did here.

My build instructions for our setup are here -->
http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/

<http://www.robert-gonzalez.com/2009/02/18/building-the-php-ms-sql-server-extension-from-source-on-ubuntu-810/>Though
I suspect you have done all that already. The only thing I could offer is to
make sure to enter the appropriate pieces of information in your FreeTDS
conf file.

HTH

On Fri, Mar 19, 2010 at 9:33 PM, Gregor at HostGIS <gregor AT hostgis.com>wrote:

> Hey guys. I'm extensively familiar with MySQL and PostgreSQL, but
> connecting to MSSQL 2008 from Linux/PHP has me stumped.
>
> My specific PHP code is this simple line:
>
> $db =
> mssql_connect('ec2-174-129-135-45.compute-1.amazonaws.com\SQLSERVER,1433',
> 'user', 'pass');
>
> The result is "Unable to connect to server"
>
>
> Client platform:
> PHP 5.2.13
> Mostly PHP CLI for testing, will be Apache 2.0
> Slamd64 Linux
> FreeTDS, not sure how to find the exact version but was the latest
> stable about 3 weeks ago
>
> MS SQL Server:
> SQL Server 2008
> on a Amazon EC2
>
>
> The FreeTDS log shows this:
>
> 21:13:03.249137 23593 (net.c:836):tds7_get_instance_port(174.129.135.45,
> SQLSERVER, 1433)
> 21:13:04.248694 23593 (net.c:905):tds7_get_instance_port: timed out on
> try 0 of 16
> (... and so on...)
> 21:13:19.731750 23593 (net.c:974):instance port is 0
> 21:13:19.731764 23593 (login.c:418):invalid port number
>
>
> I have verified via 'telnet' that I can connect to port 1433; not a
> firewall thing at that level.
>
> I have seen vague clues about the instance name being important, and
> some mentions that 1433 isn't the TCP port for the instance. Can someone
> explain that to me? It may be relevant that the MS SQL is on a Amazon
> EC2 instance, which has firewalls beyond the Windows Firewall. I cannot
> for instance telnet to port 25 and properly get a Connection Refused.
>
> --
> HostGIS, Open Source solutions for the global GIS community
> Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
> Network+ Server+ A+ Security+ Linux+
> PHP PostgreSQL MySQL DHTML/JavaScript/AJAX
>
> "No one cares if you can back up — only if you can recover."
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



--
Robert Gonzalez
http://www.robert-gonzalez.com
http://twitter.com/RobertGonzalez
http://www.linkedin.com/in/robertanthonygonzalez




Archive powered by MHonArc 2.6.24.

Top of Page