Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27608 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31633 invoked by uid 1010); 23 Jan 2007 16:49:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31618 invoked from network); 23 Jan 2007 16:49:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2007 16:49:50 -0000 Authentication-Results: pb1.pair.com header.from=frank@kromann.info; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=frank@kromann.info; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain kromann.info designates 64.186.239.125 as permitted sender) X-PHP-List-Original-Sender: frank@kromann.info X-Host-Fingerprint: 64.186.239.125 c-064-186-239-125.oc1.redwire.net Linux 2.5 (sometimes 2.4) (4) Received: from [64.186.239.125] ([64.186.239.125:47575] helo=mail.kromann.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/71-17963-CAC36B54 for ; Tue, 23 Jan 2007 11:49:49 -0500 Received: by mail.kromann.info (Postfix, from userid 510) id 30E184040CD; Tue, 23 Jan 2007 08:49:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on mail.kromann.info X-Spam-Level: X-Spam-Status: No, score=0.7 required=4.0 tests=AWL autolearn=ham version=3.1.7 Received: from warp (www.kromann.info [64.186.239.115]) by mail.kromann.info (Postfix) with SMTP id 4F3544040C9; Tue, 23 Jan 2007 08:49:45 -0800 (PST) To: Un Named Cc: X-Mailer: Swwwing 2000 Message-ID: <11695709717840000@9866357972520000.9866341568840000> MIME-Version: 1.0 Reply-To: "Frank M. Kromann" Date: Tue, 23 Jan 2007 08:49:31 -0800 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 4.4.0 5.2.0 and FreeTds 0.64 login trouble From: frank@kromann.info ("Frank M. Kromann") Hello, You should add a section to your freetds.conf file that looks something like this: [MyHost] host = 192.168.55.3 port = 1433 tds version = 8.0 And they set $dbhost = "MyHost"; in your php script. - Frank > 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