Solved

libraries not found by web server on UNIX

Posted on 1998-01-12
3
143 Views
Last Modified: 2013-12-25
I have a C++ CGI that I want to test on Netscape Enterprise 3.0 on a Solaris box.  When I compile my code without linking it with my libraries, it executes just fine through my Web server; however, when I link my code with my libraries, I get an error from the Web server saying that my libraries could not be found.

I have set LD_LIBRARY_PATH but it does not make any difference.  I have also tried to set that library path through the web server, but cannot find any successful way to do so.

Any ideas?
0
Comment
Question by:Kryus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1831821
How is it that you can run your program at all without linking it with your libraries?  Perhaps if you provided additional detail in your question it would help shed some light on it.
0
 

Author Comment

by:Kryus
ID: 1831822
JHance:

a) My CGI is a simple program that sends "Hello World!" back to the browser.  True, I do NOT NEED to link with libraries to make that part work.

b) The reason why I am linking with my libraries is to see how I tell my web server where to find my libraries when I make further modifications to my program.
0
 

Accepted Solution

by:
jloomis earned 50 total points
ID: 1831823
The reason your shared libraries can't be found is that the Netscape server doesn't pass through environment variables to the CGI.  Here are two ways around it:

1) You can get the server to set environment variables for you by adding a line like this to your obj.conf:

Init fn=init-cgi LD_LIBRARY_PATH=/usr/lib:/usr/local/lib

For more information on this Init function, look in the "NSAPI Programmers Guide" at http://developer.netscape.com.

2) You can make a stub program that sets the environment variable using putenv and then call exec or system to run the real CGI program.  This involves one or more additional process invocations, but will work on any web server.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question