Solved

libraries not found by web server on UNIX

Posted on 1998-01-12
3
129 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
3 Comments
 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PowerShell Get-Help 10 59
Building Windows 10 1 69
Google  (Get  Users Email) 2 63
Need sample Angular apps for study 4 33
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now