Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Sybperl rules! - FAQ suggestions
Date: Dec 11 1997 9:03PM
Adrian Scott wrote:
> from the FAQ for question 2.5) "I've moved the Sybase libraries..."
> - looks like you need to set both LD_LIBRARY_PATH
> to the sybase/lib dir, And the SYBASE environmental
> variable to the sybase dir (for it to find
> the interfaces file).
Correct. LD_LIBRARY_PATH is only there to resolve loading
.so libraries. The SYBASE environment variable must *always* be
set so that OpenClient will find the interfaces file, and for
the CTlib version that it will find the locale files as well.
> - the second part (Link the sybase libraries to
> a standard dir) -- do we need to do an "ln -s"
> on each file in sybase/lib to /usr/local/lib ?
> can you "ln -s" sybase/lib to a subdir of /usr/local/lib
> (my guess is no)... isn't totally clear from
> FAQ write-up.
> (I'm using sybperl-2.08 on solaris)
Indeed, you need to link each of the Sybase libs (.so files) to
/usr/local/lib (or /usr/lib). In csh syntax, that would be (run
from the /usr/local/lib directory)
foreach i ($SYBASE/lib/*.so)
ln -s $i .
> For folks using Sybperl with CGI, it looks like I need
> to have the web server run as a certain user and put those
> environmental variables in that user's .cshrc, unless
> I can figure out how to do the second (linking libs to /usr/local/lib),
> which I guess
> would be more elegant. I'm thinking particularly about
> folks who have different servers in production process (e.g.
> dev -> qa -> staging -> production), where the hard-coding
> of the dirs isn't so handy, and you can't do a build on
> some of the machines (e.g. production).
The *best* way to do things is to build sybp[erl so that the library
path is coded into sybperl's .so files, and then make sure that
the location of the Sybase libs is always the same on all of
the machines that will need to run the scripts.
For example, if Sybase is always located in /usr/local/sybase
then it becomes unnecessary to fool with LD_LIBRARY_PATH
at all, which makes things a lot simpler.
> Also, for the docs... do you recommend CTLib over DBLib or
> vice-versa? -- it might be nice to have an analysis of differences
> between the two somewhere...
That write-up could probably be quite usefull...
The functionality between the two is quasi identical, and the
programming model is very similar. The main issue is really
that Sybase has repeatedly stated that they will not enhance
DBlib, and that support for it might be dropped at some point in the
So I think CTlib is probably the better choice. (although
I've nearly only written DBlib apps myself - old habits die
Michael Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler