PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: HaiderAziz at caspian dot com
Subject: Error in running Sybperl CGI under Apache (Win32)
Date: Feb 5 1998 5:37PM

Hello all,

I have installed Perl 5.04_02 on Windows NT Workstation 4.0 (sp3) using
MSVC++ 5.0 and Sybperl 2.08_51 (please see the attached output.)
Everything runs ok, I have several Perl scripts that use Sybase with now
problems.

However, when I try to call a simple script with Sybperl calls via
Apache 'cgi-bin' I get this error in 'error_log':

---------
[Thu Feb 05 16:36:57 1998] Server configured -- resuming normal
operations
/Web/cgi-bin/html_tst.pl: my: command not found
/Web/cgi-bin/html_tst.pl: my: command not found
/Web/cgi-bin/html_tst.pl: my: command not found
/Web/cgi-bin/html_tst.pl: use: command not found
/Web/cgi-bin/html_tst.pl: my: command not found
/Web/cgi-bin/html_tst.pl: syntax error near unexpected token
`$dbh->dbuse(C'
/Web/cgi-bin/html_tst.pl: /Web/cgi-bin/html_tst.pl: line 9:
`$dbh->dbuse(CSLUK);'
[Thu Feb 05 16:37:04 1998] access to /Web/cgi-bin/html_tst.pl failed for
194.33.158.6, reason: Premature end of script headers
---------

So I wrote another script that explicitly gives the path to the Sybperl
libs:

------------------
#!/perl/bin/perl.exe
# Format sql output in an HTML3 table:
print "Context-type: text/html\n\n";
print "Before $ENV{SYBASE}\n
\n"; print "Before $ENV{PERL5LIB}\n
\n"; $ENV{SYBASE} = "c:\\sybase"; $ENV{PERL5LIB} = "c:\\perl\\lib;c:\\perl\\lib\\site"; print "After $ENV{SYBASE}\n
\n"; print "After $ENV{PERL5LIB}\n
\n"; my $user = sa; my $passwd = passme; my $db = test_srvr; use Sybase::DBlib; my $dbh = new Sybase::DBlib $user, $passwd, $db; wsql($dbh, "select * from sysobjects", "Objects"); <> ------------------ I get this on the browser screen: ---------------- Before Before After c:\sybase After c:\perl\lib;c:\perl\lib\site Objects <> ---------------- And now I get this in 'error_log': ---------- DB-Library error: Net-Lib protocol driver call to connect two endpoints failed Operating-system error: Error in creating a socket - Error is 10106 Can't call method "dbcmd" on unblessed reference at /Web/cgi-bin/htpl line 39. DB-Library error: Net-Lib protocol driver call to connect two endpoints failed Operating-system error: Error in creating a socket - Error is 10106 Can't call method "dbcmd" on unblessed reference at /Web/cgi-bin/htpl line 42. DB-Library error: Net-Lib protocol driver call to connect two endpoints failed Operating-system error: Error in creating a socket - Error is 10106 Can't call method "dbcmd" on unblessed reference at /Web/cgi-bin/htpl line 40. ------------------ Has anyone out there managed to get Sybperl running as CGI with Apache under NT? I have checked all my Sybase, Path, etc environment variables and they all seem to be ok. Can anyone help?! ---------------------------------------- perl -V output: ========== Summary of my perl5 (5.0 patchlevel 4 subversion 02) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32 uname='' hint=recommended, useposix=true, d_sigaction=undef bincompat3=undef useperlio=undef d_sfio=undef Compiler: cc='cl', optimize='-O', gccversion= cppflags='-DWIN32' ccflags ='-MD -DWIN32' stdchar='unsigned char', d_stdstdio=define, usevfork=false voidflags=15, castflags=0, d_casti32=define, d_castneg=define intsize=4, alignbytes=8, usemymalloc=n, randbits=15 Linker and Libraries: ld='link', ldflags ='-nologo -subsystem:windows' libpth=g:\DevStudio\VC\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib dbccp32.lib libc=msvcrt.lib, so=dll useshrplib=undef, libperl=undef Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags='', lddlflags='-dll' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING Built under MSWin32 Compiled at Aug 9 1997 21:42:37 %ENV: PERL5LIB="c:\perl\lib;c:\perl\lib\site" PERL_HOME="c:\perl" @INC: c:\perl\lib c:\perl\lib\site c:\perl\lib\site c:\perl\lib c:\perl\lib c:\perl\lib\site c:\perl\lib\site . ---------------------------------------- C:\perl\test\sybperl-2.08_51>perl Version ============================== This is sybperl, version 2.08_51 Sybase::DBlib version 1.38 11/07/97 Copyright (c) 1991-1997 Michael Peppler This is sybperl, version 2.08_51 Sybase::CTlib version 1.29 11/07/97 Copyright (c) 1995-1997 Michael Peppler Portions Copyright (c) 1995 Sybase, Inc. ---------------------------------------- Regards, Haider ********************************************************************* Caspian is not responsible for any securities related recommendation, solicitation, offer or agreement, or any information about any transaction contained in this communication. *********************************************************************