This was the issue - thanks for your help!

-----Original Message-----
From: Michael Peppler [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 4:50 PM
To: [EMAIL PROTECTED]
Subject: Re: Sybase::DBlib and CGI issue


You wrote:

>The CGI bit is working - am able to display text, forms etc correctly, but
>when try to connect to the database it fails to connect.  Oddly the same db
>connection script works in a different script - and the db connection even
>works if run from the unix command line.
>
The most likely problem is that the SYBASE environment variable (and/or 
LD_LIBRARY_PATH) isn't set correctly in the CGI's environment.

With Apache, the easiest is to set these variables in the httpd.conf 
file, like so:

SetEnv SYBASE /opt/sybase

You then have to restart the web server.

Alternatively you can make sure to set the SYBASE env. variable in your 
perl script:

use Sybase::DBlib;

    my $user = "xxxt";
    my $pwd = "yyy";
    my $server = "zzz";
    my $dbh;

    $ENV{SYBASE} = "/opt/sybase";

    if ($dbh = new Sybase::DBlib $user, $pwd, $server) {
        print "<p>Server: $server </p>\n";
        $dbh->dbuse("kplus");
    } else {
        print  "<p>Couldn't connect to $server </p>";
        return -1;
    }


Hope this helps.

Michael



----------------------------------------------------
This email with all information contained herein or attached hereto may
contain confidential and/or privileged information intended for the
addressee(s) only.  If you have received this email in error, please contact
the sender and immediately delete this email in its entirety and any
attachments thereto.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to