From mboxrd@z Thu Jan 1 00:00:00 1970 From: "yahoo" To: "Michael Hoffman" Cc: Subject: Re: perl/dbi Can't create TCP/IP socket Date: Wed, 26 Sep 2001 02:30:00 -0000 Message-id: <000901c14676$1f12de20$f04585ce@projectobjects> References: X-SW-Source: 2001-09/msg01596.html I removed ASPerl and the older cygwin DLL's. I ran a small test case for shell and apache. Here are the two files with the results just below them cygcheck and perl -V are below sqltest3.pl use DBI; # fill in the following variables $database = "projectobjects"; $host = "www.freesql.org"; $username = "projectobjects"; $password = "newman"; # mysql is the driver that I am using in this case. You can switch it to say'odbc' or whatever $dbh = DBI->connect("DBI:mysql:$database:$host:3306", $username, $password); if (not $dbh) { print "you cannot connect to the database"; } else { print "successful connect"; } exit; ############################################################################ ############# projectobjects@PROJECTOBJECTS /usr/edrive/src $ perl sqltest3.pl successful connect projectobjects@PROJECTOBJECTS /usr/edrive/src ############################################################################ ############ sqltest.cgi #!/usr/bin/perl use DBI; # fill in the following variables $db = "projectobjects"; $db_host = "www.freesql.org"; $username = "projectobjects"; $password = "newman"; $db_port = "3306"; $data_source = "DBI:mysql:$db:$db_host:$db_port"; print "Content-type: text/html\n\n"; print "\n"; print "SQL Test\n"; print "\n"; # connects to mysql. $dbh = DBI->connect("$data_source", "$username", "$password", { RaiseError => 1, PrintError => 1, AutoCommit => 1 }); if (not $dbh){ $orig_error = $DBI::errstr; if ($DBI::errstr =~ m/(.nknown database)/) { # database specified not existed print "$orig_error"; } elsif (($DBI::errstr =~ m/an't connect to/) || ($DBI::errstr =~ m/Unknown MySQL Server Host/) ) { print "$orig_error"; } else { print "connection failed: $DBI::errstr"; } print "<\body><\html>"; exit; } print "successful connect"; print "<\body><\html>"; exit; ############################################################################ ######## Content-type: text/html Software error: DBI->connect(projectobjects:www.freesql.org:3306) failed: Can't create TCP/IP socket (1) at /usr/edrive/local/apache/cgi-bin/sqltest.cgi line 18 ############################################################################ ####### Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=cygwin, osvers=1.3.2(0.3932), archname=cygwin-multi uname='cygwin_nt-4.0 loreley 1.3.2(0.3932) 2001-05-20 23:28 i686 unknown ' config_args='-de -Dusemultiplicity' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include', optimize='-O2', cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.3-5 (cygwin special)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld2', ldflags =' -s -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -lcrypt perllibs=-lcrypt libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl5_6_1.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s' cccdlflags=' ', lddlflags=' -s -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under cygwin Compiled at Aug 22 2001 01:05:05 @INC: /usr/lib/perl5/5.6.1/cygwin-multi /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/cygwin-multi /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl . ############################################################################ ######## Cygnus Win95/NT Configuration Diagnostics Current System Time: Wed Sep 26 06:27:52 2001 Win95 Ver 4.0 build 67109975 B Path: /usr/local/bin /usr/bin /bin /cygdrive/c/WINDOWS /cygdrive/c/WINDOWS/COMMAND /cygdrive/c/PROGRAM FILES/MTS SysDir: C:\WINDOWS\SYSTEM WinDir: C:\WINDOWS PWD = `/usr/edrive/src' LD_LIBRARY_PATH = `/usr/local/lib:/lib:/usr/lib' MAKE_MODE = `unix' HOME = `/home/projectobjects' PROMPT = `$p$g' DBI_PASS = `newman' DBI_DSN = `dbi:Pg' POSTGRES_INCLUDE = `/usr/include/postgresql' COMSPEC = `C:\WINDOWS\COMMAND.COM' !C: = `C:\WINDOWS' CMDLINE = `bash --login -i' HOSTNAME = `PROJECTOBJECTS' !D: = `D:\cygwin\bin' !E: = `E:\cygwin\src\soupermail' WINDIR = `C:\WINDOWS' WINBOOTDIR = `C:\WINDOWS' PS1 = `\[\033]0;\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $ ' ODBCHOME = `/usr/local' DBI_USER = `projectobjects' MACHTYPE = `i686-pc-cygwin' POSTGRES_LIB = `/usr/lib' TEMP = `/cygdrive/c/WINDOWS/TEMP' SHLVL = `1' SHELL = `/bin/bash' HOSTTYPE = `i686' OSTYPE = `cygwin' TERM = `cygwin' PGDATA = `/usr/share/postgresql/data' _ = `/usr/bin/cygcheck' OLDPWD = `/home/projectobjects' TZ = `EST5EDT4,M4.1.2/0,M10.5.0/0' HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrd er\Start Menu\&Programs\Cygnus Solutions (default) = (unsupported type) HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 (default) = `/cygdrive' cygdrive flags = 0x00000022 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/edrive (default) = `e:\cygwin' flags = 0x00000000 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/ (default) = `D:/cygwin' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = `D:/cygwin/bin' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = `D:/cygwin/lib' flags = 0x0000000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D a: fd N/A N/A c: hd FAT 1372Mb 98% CP UN DRIVE0VOL00 d: hd FAT 999Mb 99% CP UN APPS e: hd FAT 547Mb 89% CP UN D:\cygwin\bin /usr/bin system binmode D:\cygwin\lib /usr/lib system binmode D:\cygwin / system binmode e:\cygwin /usr/edrive user textmode c: /cygdrive/c user binmode,noumount d: /cygdrive/d user binmode,noumount e: /cygdrive/e user binmode,noumount Found: D:\cygwin\bin\bash.exe Found: D:\cygwin\bin\cat.exe Found: D:\cygwin\bin\cpp.exe Found: D:\cygwin\bin\find.exe Found: c:\WINDOWS\COMMAND\find.exe Warning: D:\cygwin\bin\find.exe hides c:\WINDOWS\COMMAND\find.exe Found: D:\cygwin\bin\gcc.exe Found: D:\cygwin\bin\gdb.exe Found: D:\cygwin\bin\ld.exe Found: D:\cygwin\bin\ls.exe Found: D:\cygwin\bin\make.exe Found: D:\cygwin\bin\sh.exe 56k 2000/12/02 D:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0 "cygbz21.0.dll" v0.0 ts=2000/11/20 18:53 81k 2001/04/28 D:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0 "cygitcl30.dll" v0.0 ts=2001/4/28 18:57 35k 2001/04/28 D:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0 "cygitk30.dll" v0.0 ts=2001/4/28 18:57 390k 2001/04/28 D:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0 "cygtcl80.dll" v0.0 ts=2001/4/28 18:56 5k 2001/04/28 D:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0 10k 2001/04/28 D:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0 "cygtclreg80.dll" v0.0 ts=2001/4/28 18:56 623k 2001/04/28 D:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0 "cygtk80.dll" v0.0 ts=2001/4/28 18:57 18k 2000/10/22 D:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0 "cyggdbm.dll" v0.0 ts=2000/10/22 22:26 21k 2001/06/20 D:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0 "cygintl.dll" v0.0 ts=2001/6/20 13:09 45k 2001/07/04 D:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0 "cygjbig1.dll" v0.0 ts=2001/7/3 23:25 119k 2001/06/06 D:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0 "cygjpeg6b.dll" v0.0 ts=2001/6/6 0:27 45k 2001/04/25 D:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0 "cygform5.dll" v0.0 ts=2001/4/25 1:28 26k 2001/04/25 D:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0 "cygmenu5.dll" v0.0 ts=2001/4/25 1:27 156k 2001/04/25 D:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses++5.dll" v0.0 ts=2001/4/25 1:29 226k 2001/04/25 D:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses5.dll" v0.0 ts=2001/4/25 1:17 15k 2001/04/25 D:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0 "cygpanel5.dll" v0.0 ts=2001/4/25 1:27 17k 2001/06/28 D:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0 "cyghistory4.dll" v0.0 ts=2001/1/6 23:34 21k 2001/06/28 D:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0 "cyghistory5.dll" v0.0 ts=2001/6/27 22:27 108k 2001/06/28 D:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0 "cygreadline4.dll" v0.0 ts=2001/1/6 23:34 135k 2001/06/28 D:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0 "cygreadline5.dll" v0.0 ts=2001/6/27 22:27 245k 2001/06/12 D:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0 "cygtiff3.dll" v0.0 ts=2001/6/12 13:25 41k 2001/07/04 D:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-noX4.dll" v0.0 ts=2001/7/3 21:21 45k 2001/07/04 D:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-X4.dll" v0.0 ts=2000/11/19 21:45 49k 2001/02/03 D:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0 "cygz.dll" v0.0 ts=2001/2/3 15:35 365k 2000/10/24 D:\cygwin\bin\cygdb3.dll - os=4.0 img=1.0 sys=4.0 "cygdb3.dll" v0.0 ts=2000/10/24 0:21 463k 2000/10/24 D:\cygwin\bin\cygdb_cxx3.dll - os=4.0 img=1.0 sys=4.0 "cygdb_cxx3.dll" v0.0 ts=2000/10/24 0:22 163k 2001/05/06 D:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0 "cygpng2.dll" v0.0 ts=2001/5/6 0:05 701k 2001/09/13 D:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2001/9/12 23:54 Cygwin DLL version info: dll major: 1003 dll minor: 3 dll epoch: 19 dll bad signal mask: 19005 dll old termios: 5 dll malloc env: 28 api major: 0 api minor: 46 shared data: 3 dll identifier: cygwin1 mount registry: 2 cygnus registry name: Cygnus Solutions cygwin registry name: Cygwin program options name: Program Options cygwin mount registry name: mounts v2 cygdrive flags: cygdrive flags cygdrive prefix: cygdrive prefix cygdrive default prefix: build date: Wed Sep 12 23:54:31 EDT 2001 shared id: cygwin1S3 Use -h to see help about each section -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/