Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-29-2006, 10:40 AM   #1
LQ Newbie
Registered: Feb 2004
Location: Boston, MA
Distribution: Centos
Posts: 27

Rep: Reputation: 15
correct @INC path not detected by web browser


I install RSPerl one of my systems. When I try to run a cgi script, the perl module can not found. I can run the script manually without any problem. I have manually set the LD_LIBRARY_PATH and PERL5LIB to the correct paths.

System info: running FC3, with apache 2.0.53, and perl 5.8.5.

RSPerl is installed
/usr/lib/R/library/RSPerl. is located at

When I try to run the script from /var/www/cgi-bin/mfitzpat via the web browser, the listed paths for finding in @INC are incorrect.

web browser error:
Can't locate in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5.....
EGIN failed--compilation aborted at /var/www/cgi-bin/mfitzpat/ line 4.

When I check @INC, the path to it is listed.

/$ perl -e 'print join "\n", @INC'
as well as /usr/lib/perl5/5.8.5, etc

script fails at line 4

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use R;

I have tried to append the full path to "use R", but it did not work. Gives a different error.

The httpd.conf relative entries
LoadModule cgi_module modules/

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
AllowOverride None
# Options None
Options ExecCGI
Order allow,deny
Allow from all

AddHandler cgi-script .c

So, my question is how can I get the correct @INC path for to be seen by the web browser?

Thank you for any advice.
Old 03-30-2006, 07:25 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Assuming your server is apache, you can modify httpd.conf...

# Environment variable setup
<IfModule mod_env.c>
    # Location of the application-specific perl modules.
    SetEnv YOUR_ENV_VAR /path/to/your/modules

Then, in your perl code,

use lib $ENV{YOUR_ENV_VAR};
use yourModule;
There may be a more sanitary solution, but this works for me. I'd be happy to hear of a better method.

I guess you could just do:

use lib /path/to/your/modules;

Sure, why not.

--- rod.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
which is the correct directory path? verbatim Programming 1 04-24-2005 11:22 PM
what are the correct path for ksysv, the SysV-Init Editor? Xavius Slackware 1 01-01-2005 03:11 PM
browser plugin for Konqueror web browser (linspire) Tracianddwayne Linux - Newbie 1 01-01-2005 02:15 PM
Adding the correct installation path mynameisjoe Linux - Newbie 4 05-11-2004 10:26 AM
please tell me if my path statement is correct on RH 7.3 ergo_sum Linux - Newbie 9 12-12-2003 11:41 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration