Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <marc-olivier.meunier AT bt.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Problem accessing my DB using PHP 5.1.2
  • Date: Fri, 17 Feb 2006 17:54:21 -0000

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




Archive powered by MHonArc 2.6.24.

Top of Page