SID-02289: /var/www/twiki/bin/view fails to execute due to @INC
|| TWiki version:
|| Perl version:
|| Server OS:
|| RHEL 7
|| Last update:
|| 16 hours ago
I, a TWiki newbie, installed a fresh TWiki 6.0.2 on RHEL 7, Apache 2.4, Perl 5.016, following the TWiki Installation guide. The configure script displays @INC
The configure script shows no errors for me to fix.
However, when trying to execute /var/www/twiki/bin/view, it throws the error:
Can't locate CGI/Carp.pm in @INC
contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /var/www/twiki/bin/view line 28.
BEGIN failed--compilation aborted at /var/www/twiki/bin/view line 28.
I'm at a loss as to why the @INC
values are different since running the configure script.
Can anyone provide any advice?
-- Cori Johnson - 2017-01-11
Discussion and Answer
There are two questions in there, and I think I know the answers.
- Why does
@INC show different values: TWiki does a bit of internal bookkeeping with directories, and that's what you see in
configure. This script does some extra heuristics since it must be able to run before TWiki is configured. However, in line 28 of
view, this bookkeeping has not yet been initiated (this happens in line 38).
- Why do you get the error? Well, that's a bit... disturbing. We know about a notorious problem with Red Hat, coming from the fact that they don't ship their Perl with the CGI module, which belongs to the Perl core for the rest of the world. As a countermeasure, I developed CgiContrib, which brings its own set of CGI modules which are compatible with TWiki, and which is part of TWiki 6.0.2. But as I realize now, this doesn't help at all: CgiContrib is located in the same directories where TWiki itself is, and hence CGI::Carp, which is part of the CGI distribution, can't be found as early as line 28 of
view. Bummer. (To my excuse, while I run several operating systems for testing, Red Hat Linux isn't one of them.)
This is bad news, and slightly embarrassing that we didn't see it coming. So it is back to the drawing board for TWiki on Red Hat. The advice I've got for you is, unfortunately, a bit cumbersome:
Only the last step of this needs
privileges. It will install the modules to one of the paths under
(so I guess), which is available "in time" for
Another solution would be to run TWiki in a persistent interpreter (e.g.
): This would allow to pre-load the modules from TWiki's directories before
starts. This gives better performance but is usually considered even more cumbersome than the solution above. If you want to go for it, we can help.
-- Harald Jörg - 2017-01-11
Thanks for your reply and advice. I will attempt the CGI install and see how far I get.
-- Cori Johnson - 2017-01-13
Well, trying to work with CPAN on RHEL 7 didn't get me very far. My RHEL server may not have been installed for software dev. The 'perl Makefile.PL immediately failed to find the ExtUtils
/MakeMaker.pm package. I finally found success by 'yum install'ing ExtUtils
/MakeMaker and Digest/MD5 perl packages. At last the twiki/bin/view/ script ran successfully.
Thanks for the advice. It got me going after several days of struggling.
-- Cori Johnson - 2017-01-17
Thanks for the feedback! ExtUtils::MakeMaker is another module which belongs to the Perl core, and apparently is another one suppressed by Red Hat in what they ship as Perl. I was not aware of that.
I found an article by Dave Cross (http://perlhacks.com/2015/12/long-death-cgi-pm/
) where he gives background when Red Hat removed CGI from their Perl distribution, and writes that for RHEL 6 and RHEL 7,
yum install perl-core
would fix the problem. That would have been easier for you, too, sorry for missing that. He concludes his article with the question I wonder why we haven't seen a tsunami of complaints?
Well, as far as I can say, we had lots of complaints from people trying to install TWiki on Red Hat (and its various derivatives).
-- Harald Jörg - 2017-01-17
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.