Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Do XS-components require special considerations with CGI?

by sundialsvc4 (Abbot)
on Feb 26, 2009 at 01:14 UTC ( [id://746415]=note: print w/replies, xml ) Need Help??


in reply to Do XS-components require special considerations with CGI? [SOLVED]

I am in a CGI environment here – not mod_perl.

I strongly suspect that something like LD_LIBRARY_PATH will turn out to be the crux of this issue. I would be grateful if you could kindly submit (references to...) more, and more-specific, information about exactly what I ought to do. (I theorized that use lib might be enough...)

Oh Monks, this is arkane magick beyond my ken...

A cursory Super Search on LD_LIBRARY_PATH reveals many interesting-looking posts ... but are they merely rabbits, inviting me to useless chase? If not, what exactly would the proper value be in my case? (And why, prithee, are the proper .so files “automagically found, as I would expect,” when the test-suites are run from a shell-prompt?)

“I know not!” the confused Monk exclaimed in frustrated anguish. “I know not!”

Replies are listed 'Best First'.
Re^2: Do XS-components require special considerations with CGI?
by almut (Canon) on Feb 26, 2009 at 02:06 UTC
    if you could kindly submit ... more-specific, information

    Locate your mysql.so file (presumably ./lib/perl/5.8.8/auto/DBD/mysql/mysql.so) and run (from outside of Apache, where things (hopefully) work — but on the same machine):

    $ ldd /path/to/mysql.so

    This should list its dependencies, among which there is probably something like libmysqlclient.so.15 (if everything is OK, there should be no "... => not found" entries). Note the path where this lib is found, and then arrange for the LD_LIBRARY_PATH environment variable to contain that directory in the environment of the CGI program. See "man ld.so" for what this is about. One way to set it could be in a BEGIN block in your CGI script, e.g. (I'm appending here, just in case it's non-empty)

    BEGIN { $ENV{LD_LIBRARY_PATH} .= ":/path/to/lib"; }

    Other ways would be to use a shell wrapper, or via the SetEnv Apache config directive.

    BTW, which platform are you on? I'm asking because (a) the respective system tools (like ldd) might be different, (b) there is a special issue with LD_LIBRARY_PATH on Solaris, which might apply here... sorry, overlooked the "linux host" in your OP

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://746415]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-20 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found