[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

libraries not found by web server on UNIX

Posted on 1998-01-12
3
Medium Priority
?
152 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 100 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

650 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