Chris Gansen writes:
I’m trying to exec a ruby script via FastCGI (on Apache 2.0), and
properly set the env. variable LD_LIBRARY_PATH at run time.
I’ve tried adding:
SetEnv LD_LIBRARY_PATH /path/to/lib
in a .htaccess file, but to no avail. Perl, however, happily
Setting ENV[‘LD_LIBRARY_PATH’] does not take effect either.
I set this in Apache’s httpd.conf file, in the
declaration. You will also want to make sure you declare all the
libraries needed. If you just declare “/path/to/lib”, the libraries
wouldn’t necessarily know where to find libraries in /usr/lib, for
example. Here is the line I used (on my Solaris system):
(Probably don’t really need the /usr/openwin/lib, but…)
You would have to restart Apache, but I expect you would have to do
that anyways if one could set the same thing in the .htaccess.
In the error_log, I see:
[Thu Jul 20 11:32:33 2006] [warn] FastCGI: (dynamic) server
“/web/server_root/fcgi-bin/index.fcgi” restarted (pid 11242)
cannot open shared object file: No such file or directory -
Strangely, when I execute the fcgi script from the command line, as:
$ LD_LIBRARY_PATH=/path/to/lib ./index/fcgi
./index.fcgi:25: undefined method `each_cgi’ for FCGI:Class
Which is particularly vexing. This configuration works on another
where the libraries are not in ‘special’ places.
Any advice on how to get Ruby to find the correct library?
Are you sure you’ve installed FastCGI on this system? Based on what I
see in the log file:
- The server cannot find libfcgi.so.0, which is installed with
FastCGI. Make sure the file is present.
- You’ve probably installed ruby-fcgi since it knew about
FCGI:Class, but the fcgi.so file would require the libfcgi.so library.
Did you copy the ruby libraries over, but not the system libraries?
Senior Test Engineer
Securing Connections between People, Applications, and Networks™
*** The information contained in this email message may be privileged,
confidential and protected from disclosure. If you are not the intended
recipient, any review, dissemination, distribution or copying is
strictly prohibited. If you have received this email message in error,
please notify the sender by reply email and delete the message and any