Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Pradeep Bhaskaran <bpradeep at rocketmail dot com>
Subject: Help! SybPerl script doesn't run as CGI
Date: Sep 30 1999 10:05PM

Hi All,

I had recently successfull built and installed a
dynamically linked version of Perl,Sybperl on HP-UX.

We have Netscape Enterprise Server 2.0 & HP-UX 10.20
A. I am trying to access a SYBASE database on another
HP system through perl. When I run the following
script at the unix prompt it works fine but when I try
to access it from the browser it doesn't work. I
checked the servers error log and it says:

failure: trying to GET /cgi-bin/simquery.cgi,
cgi-parse-output reports: the CGI prog
ram /pfact/ns-public/cgi-bin/sysquery.cgi did not
produce a valid header (name without value: got line "
could not open interface file.")

The permisssions for the interfaces file is ok. I
checked the SYBASE envoironment variable and it is set
correctly. LD_LIBRARY_PATH variable is not set on my
system but the path specified during compilation is
still correct. I tried setting it in a wrapper shell
script and executing the perl script it still didn't
work. I even tried setting it in the script itself. I
am able to run other perl script forms which do not
have Sybperl modules as cgi.

I'm not sure whether I have the LD_LIBRARY_PATH
problem. If possible for Netscape Enterprise Server
how do I set the LD_LIBRARY_PATH at the http server
configuration level? 

Heres the script --
use strict;


              $ENV{LD_LIBRARY_PATH} =
use Sybase::DBlib;


my $dbh = new Sybase::DBlib
my $data = $dbh->sql("select suid, uid, gid, name from
sysusers", undef, TRUE);

print "Content-type:text/html\n\n";
print "Test Page";
print "";

print "\n";
my $first = 1;
foreach my $row (@$data) {
        if($first) {
                print "\n";
                foreach (sort keys(%$row)) {
                        print "";
                print "\n";
                $first = 0;
        print "\n";
        foreach (sort keys(%$row)) {
                if($_ eq 'name') {
                        print "";
                } else {
                        print "";

        print "\n";
print "
\n"; print "\n"; Please Help! Pradeep ===== __________________________________________________ Do You Yahoo!? Bid and sell for free at