Skip to Content.
Sympa Menu

freetds - RE: [freetds] PHP4.3.8 & freetds v0.62.4 but: mssql_connect(): Write to SQL Server failed

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] PHP4.3.8 & freetds v0.62.4 but: mssql_connect(): Write to SQL Server failed
  • Date: Mon, 20 Dec 2004 14:57:25 +0100

>
> Salute !
>
> I've installed freetds v0.62.4 on Linux
> with apache 1.3.31 and PHP4.3.8.
>
> If I check freetds with the toll tsql it seems thats working fine:
>
> # ./tsql -C
> locale is
> "LC_CTYPE=de_DE@euro;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MO
> NETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TE
> LEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C"
> locale charset is "ISO-8859-15"
> Compile-time settings (established with the "configure" script):
> Version: freetds v0.62.4
> MS db-lib source compatibility: yes
> Sybase binary compatibility: unknown
> Thread safety: no
> iconv library: yes
> TDS version: 5.0
> iODBC: no
> unixodbc: no
> # /usr/local/freetds/bin/tsql -S hemera -U test -P test
> locale is
> "LC_CTYPE=de_DE@euro;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MO
> NETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TE
> LEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C"
> locale charset is "ISO-8859-15"
> 1> version
> using TDS version 4.2
> 1> quit
> #
>
> But if I do it in PHP in this way:
> $dbproc = mssql_connect("hemera","test","test")or
> die('Error:'.mssql_get_last_message());
>
> results in:
> Warning: mssql_connect(): Write to SQL Server failed.
> (severity 9) in /home/most/forms3/test/test.php on line 8
> Warning: mssql_connect(): Login incorrect. (severity 9) in
> /home/most/forms3/test/test.php on line 8
> Warning: mssql_connect(): Unable to connect to server: hemera
> in /home/most/forms3/test/test.php on line 8
> Error:
>

Did you use php from command line or using Apache? apache work using a
different user so your ~/.freetds.conf won't be read.
We don't recommend to use TDS version 4.2 (if you don't have mssql
6.x...), see UserGuide on site.

> But I dont find any entry in the log why?
>
> And the Message "Write to SQL Server failed." is generated by freetds.
>
> My question is:
> What means this error-message(Write to SQL Server failed.)?
>

Usually server close connection.

> Are there not the correct rights for wwwrun in the filesystem
> or are the environment-vars wrong....?
> The environment vars are at the end of the mail.
>
> I hope of a hint where can I search and test.
>
> Tanks a lot!
>
> Also denne, bis denne, viel Spasz noch, Ingo Klein.
> ----------------------------------------------
> Environment
> Variable Value
> LESSKEY /etc/lesskey.bin
> MANPATH
> /usr/share/man:/usr/local/man:/usr/X11R6/man:/opt/gnome/share/
> man:/usr/local/mysql/man
> INFODIR /usr/local/info:/usr/share/info:/usr/info
> NNTPSERVER news
> HOSTNAME gdi41
> XKEYSYMDB /usr/X11R6/lib/X11/XKeysymDB
> GNOME2_PATH /usr/local:/opt/gnome:/usr
> SHELL /bin/bash
> TERM xterm
> HOST gdi41
> HISTSIZE 1000
> PROFILEREAD true
> SSH_CLIENT ::ffff:1.1.1.74 2163 22
> QTDIR /usr/lib/qt3
> SSH_TTY /dev/pts/43
> USER root
> JRE_HOME /usr/lib/java/jre
> LS_COLORS
> no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40
> ;33;01:cd=40;33;01:or=40;31:ex=00;32:*.cmd=00;32:*.exe=01;32:*
> .com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.t
> bz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz
> =00;31:*.lzh=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31
> :*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*
> .avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.j
> peg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pb
> m=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=
> 01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.aiff=00;
> 32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:
> *.wav=00;32:
> XNLSPATH /usr/X11R6/lib/X11/nls
> HOSTTYPE i386
> PAGER less
> MINICOM -c on
> PATH
> /sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/
> bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bi
> n:/usr/local/mysql/bin:/usr/local/mysql/libexec:/usr/lib/java/bin
> MAIL /var/mail/root
> CPU i686
> JAVA_BINDIR /usr/lib/java/bin
> PWD /root
> INPUTRC /etc/inputrc
> JAVA_HOME /usr/lib/java
> SDK_HOME /usr/lib/java
> TEXINPUTS :/root/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX
> HOME /root
> SHLVL 2
> JDK_HOME /usr/lib/java
> OSTYPE linux
> LESS_ADVANCED_PREPROCESSOR no
> XCURSOR_THEME crystalwhite
> no_proxy localhost
> LS_OPTIONS -a -N --color=tty -T 0
> WINDOWMANAGER /usr/X11R6/bin/kde
> GTK_PATH
> /usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0
> LOGNAME root
> MACHTYPE i686-suse-linux
> LESS -M -I
> CVS_RSH ssh
> SSH_CONNECTION ::ffff:1.1.1.74 2163 ::ffff:192.168.16.2 22
> LC_CTYPE de_DE@euro
> LESSOPEN lessopen.sh %s
> PKG_CONFIG_PATH /opt/gnome/lib/pkgconfig
> INFOPATH
> /usr/local/info:/usr/share/info:/usr/info:/opt/gnome/share/info
> ACLOCAL_PATH /opt/gnome/share/aclocal
> LESSCLOSE lessclose.sh %s %s
> G_BROKEN_FILENAMES 1
> COLORTERM 1
> JAVA_ROOT /usr/lib/java
> _ /usr/local/apache/bin/httpd


bye
freddy77




  • RE: [freetds] PHP4.3.8 & freetds v0.62.4 but: mssql_connect(): Write to SQL Server failed, ZIGLIO, Frediano, VF-IT, 12/20/2004

Archive powered by MHonArc 2.6.24.

Top of Page