Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem accessing my DB using PHP 5.1.2

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Зверев Виталий Борисович <VZverev AT genesis.spb.ru>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Problem accessing my DB using PHP 5.1.2
  • Date: Sun, 19 Feb 2006 22:30:38 +0300

You are welcome on a board, Marc ;)
there is no magic, your freedts.conf was omited by php and freetds library
just works as defined by precompiled options.
It could be checked via tsql session in combination with TDSCONFDUMP.
(try to setting FREETDSCONF as full freedts.conf path in php script and
you'll be really surprised)

Sincerely yours.
-------------------------------------------------------
Vitaly Zverev, OCP DBA 8&8i
Oracle E-Business Suite &
Infiniband Linux Cluster Administrator
Genesis Ltd., St.Petersburg, Russia



> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
> marc-olivier.meunier AT bt.com
> Sent: Sunday, February 19, 2006 8:33 AM
> To: freetds AT lists.ibiblio.org
> Subject: Re: [freetds] Problem accessing my DB using PHP 5.1.2
>
> Thanks !!
>
> You gave me the right hint ! It was a port problem...
> Surprisingly it didn't change anything whether I set the port
> in the freetds.conf file or not...
> Anyway, I just changed the connection string to :
> blabla.xxxxxx.com:1433 ... And it's working :)
>
> Thanks again !
>
> --
> Marc-Olivier Meunier
>
>
> > -----Original Message-----
> > From: freetds-bounces AT lists.ibiblio.org
> > [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
> ?????? ???????
> > ?????????
> > Sent: samedi 18 février 2006 20:10
> > To: FreeTDS Development Group
> > Subject: Re: [freetds] Problem accessing my DB using PHP 5.1.2
> >
> > yes, Mark, I have one...
> > analyzing your log I have seen a strange port number (4000).
> > ...
> > Connecting to 193.149.115.38 port 4000, TDS 4.2.
> > ...
> > usually it is pointing to problem with wrong or
> misconfigured freetds
> > environment by several reasons:
> > 1) actual php user cann't read freetds.conf. (unproper chown/chmod )
> > 2) freetds library was compiled/configured with wrong path to
> > freetds.conf
> > 3) freetds.conf has wrong parameters
> > try to set FREETDSCONF and TDSCONFDUMP as mentioned in UG.
> >
> > Sincerely yours.
> > -------------------------------------------------------
> > Vitaly Zverev, OCP DBA 8&8i
> > Oracle E-Business Suite &
> > Infiniband Linux Cluster Administrator Genesis Ltd., St.Petersburg,
> > Russia
> >
> >
> >
> > ________________________________
> >
> > From: freetds-bounces AT lists.ibiblio.org
> > [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
> > marc-olivier.meunier AT bt.com
> > Sent: Saturday, February 18, 2006 7:51 PM
> > To: freetds AT lists.ibiblio.org
> > Subject: RE : [freetds] Problem accessing my DB using PHP 5.1.2
> >
> >
> > thanks for your answer
> >
> > i've tried that as well but it's not working...
> > anyway i'm trying to migrate a new machine which was
> using freetds
> > and the former configuration did not use MyServer2k... so it should
> > work as well....
> >
> > any other idea ???....
> >
> > -------- Message d'origine--------
> > De: freetds-bounces AT lists.ibiblio.org de la
> part de Зверев Виталий
> > Борисович
> > Date: sam. 18/02/2006 11:38
> > À: FreeTDS Development Group
> > Cc:
> > Objet: Re: [freetds] Problem accessing my DB
> using PHP 5.1.2
> >
> >
> >
> > Hi Marc-Olivier Meunier,
> > Perhaps php connect should be: $sql_id =
> > mssql_connect("MyServer2k","OIS","OIS");
> > (look at reference in UG
> > http://www.freetds.org/userguide/freetdsconf.htm#FREETDSCONFPURPOSE)
> >
> > Sincerely yours.
> > -------------------------------------------------------
> > Vitaly Zverev, OCP DBA 8&8i
> > Oracle E-Business Suite &
> > Infiniband Linux Cluster Administrator
> > Genesis Ltd., St.Petersburg, Russia
> >
> >
> >
> > > -----Original Message-----
> > > From: freetds-bounces AT lists.ibiblio.org
> > > [mailto:freetds-bounces AT lists.ibiblio.org] On
> Behalf Of
> > > marc-olivier.meunier AT bt.com
> > > Sent: Friday, February 17, 2006 8:54 PM
> > > To: freetds AT lists.ibiblio.org
> > > Subject: [freetds] Problem accessing my DB
> using PHP 5.1.2
> > >
> > > Hi,
> > >
> > > I've just compiled a brand new php 5.1.2 with
> oracle, mysql
> > > and freetds support but I cannot connect to
> my SQL Server boxes...
> > > I just get Warning telling this :
> > > Warning: mssql_connect()
> > [function.mssql-connect]: Unable to
> > > connect to
> > > server: grishka.xxxxxxx.fr in
> > >
> > /usr/local/www/gulussa/htdocs/OIS/inc/get_config.php on line 3
> > >
> > > I can connect easily with tsql and execute
> sp_helpdb on my
> > database...
> > >
> > > Here is the ./configure for compiling freetds
> > : ./configure
> > > --prefix=/usr/local/freetds ...
> > > Here is the ./configure for php : ./configure
> > >
> > --with-oci8=instantclient,/usr/lib/oracle/10.2.0.1/client/lib/
> > > --with-mysql=/usr/local/mysql --with-ldap --with-xml
> > > --with-zlib --with-mssql=/usr/local/freetds
> > > --enable-track-vars --with-gd --enable-sigchild
> > > --with-apxs2=/opt/apache/apache_2.0.55/bin/apxs
> > > --enable-soap --without-sqlite
> > >
> > > I've copied the file freetds.conf at /usr/local/etc/
> > >
> > > Here is the freetds.log :
> > >
> > > 18:19:40.541019 Starting log file for FreeTDS 0.63
> > > on 2006-02-17 18:19:40 with debug level 99.
> > > 18:19:40.541344 names for ISO-8859-1: ISO-8859-1
> > > 18:19:40.541372 names for UTF-8: UTF-8
> > > 18:19:40.541390 names for UCS-2LE: UCS-2LE
> > > 18:19:40.541406 names for UCS-2BE: UCS-2BE
> > > 18:19:40.541433 iconv to convert client-side
> data to the
> > "ISO-8859-1"
> > > character set
> > > 18:19:40.541485 tds_iconv_info_init: converting
> > > "ISO-8859-1"->"UCS-2LE"
> > > 18:19:40.541526 Connecting to 193.149.115.38
> port 4000, TDS 4.2.
> > > 18:19:40.541779 Sending packet
> > > 0000 02 00 02 00 00 00 00 00-67 75 6c 75 73 73 61 00
> > > |........ gulussa.| 0010 00 00 00 00 00 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |........ ........| 0020 00 00 00
> 00 00 00 07
> > > 4f-49 53 00 00 00 00 00 00 |.......O
> IS......| 0030 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 0040 00 00 00 00 00 03 4f 49-53 00 00 00 00 00 00 00
> > > |......OI S.......| 0050 00 00 00 00 00 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |........ ........| 0060 00 00 00
> 00 03 33 37
> > > 38-37 36 00 00 00 00 00 00 |.....378
> 76......| 0070 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 0080 00 00 00 05 03 01 06 0a-09 01 00 00 00 00 02 00
> > > |........ ........| 0090 00 00 00 00 50 48 50
> > 20-35 00 00 00
> > > 00 00 00 00 |....PHP 5.......| 00a0 00 00 00
> 00 00 00 00
> > > 00-00 00 00 00 00 00 00 00 |........
> > ........| 00b0 00 00 05
> > > 67 72 69 73 68-6b 61 2e 66 72 61 6e 63
> > |...grish ka.xxxxx|
> > > 00c0 65 6e 65 74 2e 66 72 00-00 00 00 00 00 00 00 00
> > > |xxxx.fr. ........| 00d0 00 14 4f 49 53 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |..OIS... ........| 00e0 00 00 00
> 00 00 00 00
> > > 00-00 00 00 00 00 00 00 00 |........
> > ........| 00f0 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > > |........ ........| 0110 00 00 00 00 00 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |........ ........| 0120 00 00 00
> 00 00 00 00
> > > 00-00 00 00 00 00 00 00 00 |........
> > ........| 0130 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > > |........ ........| 0150 00 00 00 00 00 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |........ ........| 0160 00 00 00
> 00 00 00 00
> > > 00-00 00 00 00 00 00 00 00 |........
> > ........| 0170 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > > |........ ........| 0190 00 00 00 00 00 00 00
> 00-00 00 00 00
> > > 00 00 00 00 |........ ........| 01a0 00 00 00
> 00 00 00 00
> > > 00-00 00 00 00 00 00 00 00 |........
> > ........| 01b0 00 00 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |........ ........|
> > > 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
> > > |........ ........| 01d0 00 03 04 02 00 00 44
> 42-2d 4c 69 62
> > > 72 61 72 79 |......DB -Library| 01e0 0a 00 00
> 00 00 00 0d
> > > 11-75 73 5f 65 6e 67 6c 69 |........
> > us_engli| 01f0 73 68 00
> > > 00 00 00 00 00-00 00 00 00 00 00 00 00
> > |sh...... ........|
> > >
> > > 18:19:40.542167 TDS: Write failed in tds_write_packet
> > > Error: 111 (Connection refused)
> > > 18:19:40.545733 tds_client_msg: #20006:
> > "Write to SQL Server failed.".
> > > Connection state is now 0.
> > > 18:19:40.545780 tds_process_login_tokens()
> 18:19:40.545800
> > > looking for login token, got 0()
> > > 18:19:40.545825 tds_process_default_tokens()
> marker is 0()
> > > 18:19:40.545844 leaving
> > tds_process_default_tokens() connection dead
> > > 18:19:40.545863 tds_client_msg: #20014:
> > "Login incorrect.".
> > > Connection state is now 4.
> > > 18:19:40.545882 tds_free_all_results()
> > > [root@gulussa tmp]#
> > >
> > > I've checked my connect string which looks ok... :
> > >
> > > $sql_id =
> > mssql_connect("grishka.xxxxxxx.fr","OIS","OIS");
> > >
> > > Here is my freetds.conf file :
> > >
> > > [global]
> > > # TDS protocol version
> > > tds version = 4.2
> > > dump file = /tmp/freetds.log
> > > debug level = 10
> > > text size = 64512
> > >
> > > [MyServer2k]
> > > host = grishka.xxxxxxxxx.fr
> > > port = 1433
> > > tds version = 8.0
> > >
> > > I've set mssql.textlimit and mssql.textsize
> to 409600...
> > >
> > > Anything else to add ???
> > >
> > > Should I strace the process ????
> > >
> > > I'm getting crazy... :(
> > >
> > >
> > >
> > > --
> > > Marc-Olivier Meunier
> > > _______________________________________________
> > > FreeTDS mailing list
> > > FreeTDS AT lists.ibiblio.org
> > > http://lists.ibiblio.org/mailman/listinfo/freetds
> > >
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> >
> >
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> >
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



Archive powered by MHonArc 2.6.24.

Top of Page