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: abe dot crabtree at citicorp dot com
Subject: RE: $SYBASE not recognized
Date: Jul 23 2002 3:03PM

I know this isn't what you're asking, but I don't think applications should 
ever set their own environment - otherwise it's not an "environment".  I think 
you'd find it easier to set the environment in the UNIX user's environment 
first.  Then you could debug with isql (which you should always have working 
for the user anyway.)

Normally the OC environment (SYBASE, SYBASE_OCS, the path, lib paths, 
SHLIB_PATH,) would be in a shell script and called from a .profile or other 
login script.

The values should be in the envt of the user that runs cgi scripts ("nobody"?)

I think someone else has found the problem with the leading /.

Usually a Sybase OC installation generates an example script somewhere called 
SYBASE.sh (but I don't know about linux.)

I hope that helps,

Regards,

Abe Crabtree


-----Original Message-----
From: abrown [mailto:abrown@mmm.com]
Sent: 23 July 2002 15:53
To: SYBPERL-L
Cc: abrown
Subject: $SYBASE not recognized


I'm not sure if this is better suited for the perl mailing list or the
Sybperl mailing list, but here goes:

I have Sybperl 2.14 installed on Linux.  I am writing a cgi script to
gather stats from various Sybase servers.  Since I cannot guarantee what
environment variables the web server will have set (nearly none, I assume)
I am trying to explicitly set $SYBASE in the .cgi script, something like
this:

#!/usr/bin/perl

$ENV{"SYBASE"}="/opt/sybase";
$ENV{"SYBASE_OCS"}="/OCS-12_5";
$ENV{"SYBASE_ASE"}="/ASE-12_5";  # Don't think this is necessary, but tried
it anyhow...
$ENV{"LD_LIBRARY_PATH"}="$ENV{SYBASE}/OCS/lib";
$SYBASE=$ENV{"SYBASE"};       # Don't think this is necessary, either...
$SYBASE_OCS=$ENV{"SYBASE_OCS"};       # same here

use Sybase::CTlib;

... etc etc etc ...

However, I still get the following error, as if $SYBASE is not set ($SYBASE
should be set to /opt/sybase):

--- begin error ---
The context allocation routine failed when it tried to load localization
files!!
One or more following problems may caused the failure

Your sybase home directory is /home/sybase. Check the environment variable
SYBASE if it is not the one you want!
Cannot access file /home/sybase/config/objectid.dat
Sybase::CTlib initialize: cs_ctx_alloc() failed at
/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 225.
Compilation failed in require at ./testme.cgi line 10.
BEGIN failed--compilation aborted at ./testme.cgi line 10.
--- end error ---

If I set $SYBASE in bash before executing the script, it runs fine, but
that doesn't help me from a web server perspective.  Any ideas?

Thanks,

Arlan