Solved

libraries not found by web server on UNIX

Posted on 1998-01-12
3
146 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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…

729 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