SID-02079: Configure error Failed to load the perl module CGI qw(:any).
| Status: |
Answered |
TWiki version: |
6.0.1 |
Perl version: |
5.10.1 |
| Category: |
CategoryInstallation |
Server OS: |
Red Hat Enterprise Linux Server release 6.6 (Santiago) |
Last update: |
10 years ago |
Hi I'm trying to install TWiki 6.0.1 on Linux RHEL6.5 perl version 5.10.1.
(Sorry I may have raised this as
TWikiGuest also)
When I run perl -e 'use CGI; print $CGI::VERSION."\n"' shows version 4.21.
The error I see is below:
Failed to load the perl module CGI qw(:any). The module could not be found.
Please ensure that:
- CGI qw(:any) is installed,
- that the module is available on the @INC
path,
- that the webserver user (root) has permission to read the CGI qw(:any).pm file.
The detailed error seen was: CGI -any pragma has been REMOVED. You should audit your code for any use of none supported / incorrectly spelled tags and remove them at /usr/local/share/perl5/CGI.pm line 925. BEGIN failed--compilation aborted at (eval 6) line 2.
From the required packages page and the install guide I believe I have installed everything. I have seen some older articles for TWiki 4 saying to comment out the -w from the perl invocation, I have tried that with no luck.
--
Steve Parry - 2015-06-28
Discussion and Answer
This is a consequence of incompatible changes in CGI.pm, beginning with version 4.05. You seem to have picked up a pretty recent version from CPAN, which unfortunately isn't a good idea, because it does't fit the current TWiki codebase.
CGI.pm is part of the Perl core, so there should be no need to install it manually!
If you don't need a version greater than 4.04 (TWiki doesn't), then the easiest remedy would be to remove your local installation of CGI and use the version of CGI which came with your version of Perl (I guess it is 3.43), or to install a version
less than 4.05.
--
Harald Jörg - 2015-06-29
Thanks Harald for the prompt response. That is the system install of perl and not a local installation. I guess the requirements should add a <4.05 for CGI.
Following downgrading to 4.03 it is no throwing an error on do/configure:
Use of uninitialized value $txt2 in string eq at /var/www/twiki/lib/TWiki/Configure/Checker.pm line 134.
This is in the checkCanCreateFile sub, I'm not overly familiar with perl but it seems to have passed the can write and read file but the <IN_FILE> isn't setting a value for $txt2. is this another prerequisite I've setup incorrectly?
Steve
--
Steve Parry - 2015-06-29
Hello Steve,
Yes, this looks like a system install: Perl 5.10.1 is six years old... However, I have some doubts about CGI.pm, but I am not familiar with Red Hat. I have only one system with Perl 5.10.1 left, and it has CGI version 3.43. Does Red Hat ship its Perl without CGI so that users need to install it from CPAN? Or did you install it with Red Hat's package manager?
Anyway, I doubt that CGI has anything to do with your current problem, which looks very strange indeed. This looks more like a problem with the file system. Just a wild guess: Did you configure any of TWiki's log files to /dev/null? That would perfectly explain the symptoms, because the checkers don't permit logging to nowhere right now.
--
Harald Jörg - 2015-06-29
This was a default build of Red Hat I did have to add CGI which I added from CPAN. As far as I recall I didn't configure any of the logging in TWiki. Maybe I missed that in the install instructions. I'll give that another read before looking into other wiki options.
Thanks.
--
Steve Parry - 2015-06-30
If you haven't configured any of the logging options, then you are ok: The default settings write log files to TWiki's data directory, which needs to be writable by the user id under which Apache is running (apache in Red Hat?).
The other file TWiki tries to check with this routine is its own local configuration file,
LocalSite.cfg. This file will be created in TWiki's lib directory when configure is run for the first time. The error message you get indicates that there is no such file which is quite normal behaviour for a first run of configure.
I have no idea why the sequence of writing to a file and then reading the same file would not succeed unless the file is sort of a kitchen sink. TWiki's behaviour can be improved in that case: it shouldn't die with "uninitialized" but return normally, providing the file name causing the problem. I'll file a bug report for that, but this does not solve the root cause. I am afraid that tweaking the code might be the only way to narrow down your problem...
--
Harald Jörg - 2015-06-30
Thanks Harald I was just about to post a new comment but before I could start I saw an email notification to say the ticket had been updated. I went along the default lines of "restart the app" and if that fails "restart the server" fortunately I didn't need to go further than restarting the webserver. I got "configure" to run and am about to move on to the next steps, user setup and some customization ( guess the gods of TWiki heard my thoughts of abandoning TWiki for another wiki and decided to behave).
Thank you again for all your help. No doubt I'll probably stumble across a few other Gotchas and will be back on here seek assistance in the not to distant future.
Regards Steve
--
Steve Parry - 2015-06-30
You're welcome
I am flagging this one as answered, so please just open a new ticket for the next problem. I've also filed
Bugs:Item7672
to get rid of the useless "use of uninitialized variable" error message.
--
Harald Jörg - 2015-06-30
Some additional background info:
--
Markus Schuh - 2015-08-15
See updated
TWikiSystemRequirements.
See how we address the moving CGI target:
AddCGIpmToTWikiCore.
--
Peter Thoeny - 2015-08-16
A new extension is now available that addresses the CGI issue:
CgiContrib - for background see
AddCGIpmToTWikiCore.
--
Peter Thoeny - 2015-10-28
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.