Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27598 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49173 invoked by uid 1010); 23 Jan 2007 11:56:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49158 invoked from network); 23 Jan 2007 11:56:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2007 11:56:49 -0000 Authentication-Results: pb1.pair.com header.from=jimthefreeman@yahoo.com; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=jimthefreeman@yahoo.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.com from 209.191.125.26 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: jimthefreeman@yahoo.com X-Host-Fingerprint: 209.191.125.26 web38310.mail.mud.yahoo.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [209.191.125.26] ([209.191.125.26:36683] helo=web38310.mail.mud.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/51-31104-008F5B54 for ; Tue, 23 Jan 2007 06:56:49 -0500 Received: (qmail 41405 invoked by uid 60001); 23 Jan 2007 11:56:46 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=1KXMhC36c6uLVPGMbPnnpRQknOA6aTvGHMqvCDmLy2pqOtZ9kS9XwVyuiS0ae4XSAK31Rtn0WlSOxpHemafY7G0gd+GcpmnPHgroViAabok97kDSrrQIlcyjjrt8azTHRtJp6Yt5cgX/IMY7kqnY/fB7mbj11YJGi6om7c+zqG0=; Received: from [82.77.91.249] by web38310.mail.mud.yahoo.com via HTTP; Tue, 23 Jan 2007 03:56:46 PST Date: Tue, 23 Jan 2007 03:56:46 -0800 (PST) To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-925695994-1169553406=:40628" Content-Transfer-Encoding: 8bit Message-ID: <656340.40628.qm@web38310.mail.mud.yahoo.com> Subject: PHP 4.4.0 5.2.0 and FreeTds 0.64 login trouble From: jimthefreeman@yahoo.com (Un Named) --0-925695994-1169553406=:40628 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello, I have a Linux server that's running PHP 4.4.0 and 5.2.0 along with FreeTDS 0.64 I am trying to connect to a MS SQL Server 2005 with PHP and I encounter a problem. Here is the php script content: $dbhost = "192.168.55.3:1433"; $dbuser = "sa"; $dbpass = "samepassword"; $db = mssql_connect($dbhost,$dbuser,$dbpassword) or die("Unable to connect to server"); Output of runnign script:
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'sa'. (severity 14) in /bin/pipe.php on line 7

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.55.3:1433 in /bin/pipe.php on line 7
Anyway if I am logging using tsql it works: [root@softlink bin]# tsql -C Compile-time settings (established with the "configure" script): Version: freetds v0.64 MS db-lib source compatibility: yes Sybase binary compatibility: unknown Thread safety: yes iconv library: yes TDS version: 8.0 iODBC: no unixodbc: no [root@softlink bin]# tsql -S 192.168.55.3 -U sa locale is "en_US.UTF-8" locale charset is "UTF-8" Password: 1> The freetds.log files are different in each case: [working - running by tsql] .... 02:30:59.504763 1052 (iconv.c:361):iconv to convert client-side data to the "UTF-8" character set 02:30:59.504906 1052 (iconv.c:514):tds_iconv_info_init: converting "UTF-8"->"UCS-2LE" 02:30:59.505100 1052 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:30:59.505193 1052 (net.c:168):Connecting to 192.168.55.3 port 1433. 02:30:59.505951 1052 (write.c:134):tds_put_string converting 8 bytes of "softlink" 02:30:59.506271 1052 (write.c:162):tds_put_string wrote 16 bytes 02:30:59.506321 1052 (write.c:134):tds_put_string converting 2 bytes of "sa" 02:30:59.506360 1052 (write.c:162):tds_put_string wrote 4 bytes 02:30:59.506398 1052 (write.c:134):tds_put_string converting 4 bytes of "TSQL" 02:30:59.506434 1052 (write.c:162):tds_put_string wrote 8 bytes 02:30:59.506467 1052 (write.c:134):tds_put_string converting 12 bytes of "192.168.55.3" 02:30:59.506503 1052 (write.c:162):tds_put_string wrote 24 bytes 02:30:59.506536 1052 (write.c:134):tds_put_string converting 11 bytes of "TDS-Library" 02:30:59.506571 1052 (write.c:162):tds_put_string wrote 22 bytes 02:30:59.506604 1052 (write.c:134):tds_put_string converting 10 bytes of "us_english" 02:30:59.506640 1052 (write.c:162):tds_put_string wrote 20 bytes 02:30:59.506673 1052 (write.c:162):tds_put_string wrote 0 bytes 02:30:59.506849 1052 (token.c:310):tds_process_login_tokens() 02:30:59.508366 1052 (net.c:446):Received header 0000 04 01 01 95 00 33 01 00- |.....3..| [non working - running by php] .... 02:31:37.444823 1059 (iconv.c:361):iconv to convert client-side data to the "ISO-8859-1" character set 02:31:37.444969 1059 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:31:37.445067 1059 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:31:37.445145 1059 (net.c:168):Connecting to 192.168.55.3 port 1433. 02:31:37.446876 1059 (write.c:134):tds_put_string converting 8 bytes of "softlink" 02:31:37.447186 1059 (write.c:162):tds_put_string wrote 16 bytes 02:31:37.447269 1059 (write.c:134):tds_put_string converting 2 bytes of "sa" 02:31:37.447311 1059 (write.c:162):tds_put_string wrote 4 bytes 02:31:37.447349 1059 (write.c:134):tds_put_string converting 7 bytes of "PHP 4.0" 02:31:37.447385 1059 (write.c:162):tds_put_string wrote 14 bytes 02:31:37.447418 1059 (write.c:134):tds_put_string converting 12 bytes of "192.168.55.3" 02:31:37.447453 1059 (write.c:162):tds_put_string wrote 24 bytes 02:31:37.447485 1059 (write.c:134):tds_put_string converting 10 bytes of "DB-Library" 02:31:37.447520 1059 (write.c:162):tds_put_string wrote 20 bytes 02:31:37.447553 1059 (write.c:134):tds_put_string converting 10 bytes of "us_english" 02:31:37.447587 1059 (write.c:162):tds_put_string wrote 20 bytes 02:31:37.447620 1059 (write.c:162):tds_put_string wrote 0 bytes 02:31:37.447814 1059 (token.c:310):tds_process_login_tokens() 02:31:37.449340 1059 (net.c:446):Received header 0000 04 01 00 74 00 33 01 00- |...t.3..| The main difference here appears to be the charset that is set as UTF-8 in TSQL query regardless of freetds.conf that I specified in cmd line. PHP appears to use ISO-8859-1, is this the reason of failure and if so is there a fix? Or it is a library issue? Thank you for your time, any help is appreciated. Jim --------------------------------- Get your own web address. Have a HUGE year through Yahoo! Small Business. --------------------------------- Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers. --0-925695994-1169553406=:40628--