Skip to Content.
Sympa Menu

freetds - Re: [freetds] php mssql_connect() without section name in freetds.conf

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] php mssql_connect() without section name in freetds.conf
  • Date: Sat, 6 Feb 2016 12:15:38 +0000

That's weird. It's not clear how the first mssql_connect parameter is
passed to FreeTDS.
Could you try to set TDSDUMPCONFIG and not only TDSDUMP or (even better)
After first connect try to do another connect (even if first fails)?
On the log we should see dbopen call.

Frediano


2016-02-05 16:49 GMT+00:00 Muresanu A.V. (Andrei Valentin)
<andrei.muresanu AT ing.ro>:
> Doesn't work. It's the same as not mentioning the port at all. Tries on
> port 4000 instead:
>
> 20009: "Unable to connect: Adaptive Server is unavailable or does not exist"
>
> log.c:196:Starting log file for FreeTDS 0.91
> on 2016-02-05 18:46:24 with debug flags 0x4fff.
> iconv.c:330:tds_iconv_open(0x2b9bfd0, UTF-8)
> iconv.c:187:local name for ISO-8859-1 is ISO-8859-1
> iconv.c:187:local name for UTF-8 is UTF-8
> iconv.c:187:local name for UCS-2LE is UCS-2LE
> iconv.c:187:local name for UCS-2BE is UCS-2BE
> iconv.c:349:setting up conversions for client charset "UTF-8"
> iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion
> iconv.c:391:preparing iconv for "ISO-8859-1" <-> "UCS-2LE" conversion
> iconv.c:394:tds_iconv_open: done
> net.c:205:Connecting to 10.98.97.95 port 4000 (TDS version 7.1)
> net.c:270:tds_open_socket: connect(2) returned "Operation now in progress"
> net.c:316:tds_open_socket() failed
> util.c:331:tdserror(0x2a89fa0, 0x2b9bfd0, 20009, 115)
> dblib.c:7906:dbperror(0x2b9b5f0, 20009, 115)
> dblib.c:7958:20009: "Unable to connect: Adaptive Server is unavailable or
> does not exist"
> dblib.c:7979:"Unable to connect: Adaptive Server is unavailable or does not
> exist", client returns 2 (INT_CANCEL)
> util.c:361:tdserror: client library returned TDS_INT_CANCEL(2)
> util.c:384:tdserror: returning TDS_INT_CANCEL(2)
> dblib.c:1424:dbclose(0x2b9b5f0)
> dblib.c:258:dblib_del_connection(0x7fe324a6b1a0, 0x2b9bfd0)
> mem.c:615:tds_free_all_results()
> dblib.c:305:dblib_release_tds_ctx(1)
> dblib.c:5859:dbfreebuf(0x2b9b5f0)
> dblib.c:724:dbloginfree(0x2b9b020)
> dblib.c:1493:dbexit(void)
> dblib.c:305:dblib_release_tds_ctx(1)
>
> -----Original Message-----
> From: FreeTDS [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
> jezekj AT centrum.cz
> Sent: Friday, February 05, 2016 6:19 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] php mssql_connect() without section name in
> freetds.conf
>
> Not sure, but in old Sybase times port has been delimited by space. i.e.
> "10.98.97.96 62220". Maybe I'm totally wrong here, but give it a try.
>
> JJ
>
> 5. Ășnora 2016 10:27:12 CET, "Muresanu A.V. (Andrei Valentin)"
> <andrei.muresanu AT ing.ro> napsal:
>>Hi,
>>
>>anybody have any idea with the following ?
>>
>>Does not work, gives 'Unknown host machine name'. Even with tds version
>>= 7.0... 7.1, 8, etc..:
>>
>>$link = mssql_connect("10.98.97.96:62220", 'user', 'pass');
>>
>>Works because there is a section in freetds.conf named 'dasdswh':
>>
>>$link = mssql_connect('dasdswh', 'user', 'pass');
>>
>>$ php -v
>>PHP 5.5.21 (cli) (built: Jun 10 2015 05:26:44) Copyright (c) 1997-2014
>>The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend
>>Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by
>>Zend Technologies
>>
>>Trace log:
>>
>>16:55:35.585240 15567 (log.c:196):Starting log file for FreeTDS 0.91
>> on 2016-02-04 16:55:35 with debug flags 0xffff.
>>16:55:35.585295 15567 (iconv.c:330):tds_iconv_open(0x2569f10, UTF-8)
>>16:55:35.585508 15567 (iconv.c:187):local name for ISO-8859-1 is
>>ISO-8859-1
>>16:55:35.585528 15567 (iconv.c:187):local name for UTF-8 is UTF-8
>>16:55:35.585542 15567 (iconv.c:187):local name for UCS-2LE is UCS-2LE
>>16:55:35.585560 15567 (iconv.c:187):local name for UCS-2BE is UCS-2BE
>>16:55:35.585578 15567 (iconv.c:349):setting up conversions for client
>>charset "UTF-8"
>>16:55:35.585590 15567 (iconv.c:351):preparing iconv for "UTF-8" <->
>>"UCS-2LE" conversion
>>16:55:35.585610 15567 (iconv.c:391):preparing iconv for "ISO-8859-1"
>><-> "UCS-2LE" conversion
>>16:55:35.585635 15567 (iconv.c:394):tds_iconv_open: done
>>16:55:35.585647 15567 (util.c:331):tdserror(0x245d490, 0x2569f10,
>>20013, 0)
>>16:55:35.585666 15567 (dblib.c:7906):dbperror(0x2569530, 20013, 0)
>>16:55:35.585681 15567 (dblib.c:7958):20013: "Unknown host machine name"
>>16:55:35.585717 15567 (dblib.c:7979):"Unknown host machine name",
>>client returns 2 (INT_CANCEL)
>>16:55:35.585734 15567 (util.c:361):tdserror: client library returned
>>TDS_INT_CANCEL(2)
>>16:55:35.585751 15567 (util.c:384):tdserror: returning
>>TDS_INT_CANCEL(2)
>>16:55:35.585766 15567 (login.c:417):IP address pointer is empty
>>16:55:35.585776 15567 (login.c:419):Server 10.98.97.96:62220 not found!
>>16:55:35.585795 15567 (dblib.c:1424):dbclose(0x2569530)
>>16:55:35.585815 15567
>>(dblib.c:258):dblib_del_connection(0x7f78f16cd800, 0x2569f10)
>>16:55:35.585862 15567 (mem.c:615):tds_free_all_results()
>>16:55:35.585890 15567 (dblib.c:305):dblib_release_tds_ctx(1)
>>16:55:35.585909 15567 (dblib.c:5859):dbfreebuf(0x2569530)
>>16:55:35.592809 15567 (dblib.c:724):dbloginfree(0x2569510)
>>16:55:35.594342 15567 (dblib.c:1493):dbexit(void)
>>16:55:35.594378 15567 (dblib.c:305):dblib_release_tds_ctx(1)
>>




Archive powered by MHonArc 2.6.24.

Top of Page