Most revered monks,
I have the following simple Perl script (called "hellom.cgi"):
__BEGIN__ #!/usr/bin/perl use CGI qw/:standard :html3/; use CGI::Carp qw( fatalsToBrowser ); $CGI::POST_MAX=1024 * 100; # max 100K posts1 #-------------------------------------------------- # BEGIN { # if ( $ENV{PERL5LIB} and $ENV{PERL5LIB} =~ /^(.*)$/ ) { # # # Blindly untaint. Taintchecking is to protect # # from Web data; # # the environment is under our control. # eval "use lib '$_';" foreach ( # reverse # split( /:/, $1 ) # ); # } # } #-------------------------------------------------- use Acme::Spork; use Bio::Tools::GuessSeqFormat; print "Content-type: text/html\n\n"; print "Hello World !! It works.\n"; __END__
Which is stored under: /usr/local/apache/htdocs/Test/cgi-bin And the actual website can be accessed here. It gives error message like this:
Software error: Can't locate Acme/Spork.pm in @INC (@INC contains: /home/sadm/lib/site +_perl/ /home/sadm/lib/site_perl/sun4-solaris-64int /usr/perl5/5.8.4/l +ib/sun4-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4 +/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl / +usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int /usr/perl5/vendor_perl +/5.8.4 /usr/perl5/vendor_perl .) at /usr/local/apache/htdocs/Test/cgi +-bin/hellom.cgi line 25. BEGIN failed--compilation aborted at /usr/local/apache/htdocs/Test/cgi +-bin/hellom.cgi line 25. For help, please send mail to the webmaster (admin@your-domain.com), g +iving this error message and the time and date of the error.
As you can see from that link it shows that it can't locate Acme::Spork at the shown path there - although the path stated above (the one under /home) is already consistent with my htaccess path below:
SetEnv PERL5LIB /home/sadm/lib/site_perl/sun4-solaris-64int:/home/sadm +/lib/site_perl/
The .htaccess is located here: /usr/local/apache/htdocs/Test.
Moreover checking the location of the module it consistently shows the correct path:
sadm@bioinfo-z:~/lib/site_perl/Acme$ ls Spork.pm sadm@bioinfo-z:~/lib/site_perl/Acme$ pwd /home/sadm/lib/site_perl/Acme
My question is why my Apache can't locate the location given my correct .htaccess path? Thus my script won't work?

Update: Problem solved. Thanks to ikegami!.

Regards,
Edward
PS: My httpd.conf is this and modules.conf is this.

In reply to Accessing Perl Modules Through .htaccess by monkfan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.