SID-02103: Configure Broken : Failed to load the perl module CGI
| Status: |
Answered |
TWiki version: |
6.0.1 |
Perl version: |
TWiki-VM-6.0.1-1 |
| Category: |
CategoryInstallation |
Server OS: |
RedHat - TWiki-VM-6.0.1-1 |
Last update: |
7 years ago |
Hi,
I was trying to have
DirectedGraphPlugin working. I installed a few Perl modules and all of a sudden, I can't configure my twiki any more (twiki is still working all right though). The page says :
Software error:
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 (apache) 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/share/perl5/CGI.pm line 925.
BEGIN failed--compilation aborted at (eval 7) line 2.=
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
So i typed perl -MCPAN -e 'upgrade CGI' and got the following message : all modules are up to date for CGI
I tryed to set the permissions for twiki (not sure how to do that for perl)
But I still get the same message
--
Sebastien Digard - 2015-09-17
Discussion and Answer
I am sorry you run into the CGI module gotcha. It is a moving target with incompatible changes.
See
SID-02079 and
AddCGIpmToTWikiCore.
--
Peter Thoeny - 2015-09-18
Thanks Peter.
I am not out of the woods yet... Those guys have a grater experience than I have, so I'm blocked at the 'downgrading CGI to 4.03'.
I downloaded the 4.03 version, and tried to install it following the process described here :
Install_CPAN_modules_manually
But I get an error:
Array found where operator expected at /usr/share/perl5/CGI/Carp.pm line 483, at end of line
(Do you need to predeclare Carp::longmess?)
Array found where operator expected at /usr/share/perl5/CGI/Carp.pm line 484, at end of line
(Do you need to predeclare Carp::shortmess?)
Array found where operator expected at /usr/share/perl5/CGI/Carp.pm line 485, at end of line
(Do you need to predeclare Carp::shortmess?)
Array found where operator expected at /usr/share/perl5/CGI/Carp.pm line 486, at end of line
(Do you need to predeclare Carp::longmess?)
syntax error at /usr/share/perl5/CGI/Carp.pm line 483, near "Carp::longmess @_"
syntax error at /usr/share/perl5/CGI/Carp.pm line 484, near "Carp::shortmess @_"
syntax error at /usr/share/perl5/CGI/Carp.pm line 485, near "Carp::shortmess @_"
syntax error at /usr/share/perl5/CGI/Carp.pm line 486, near "Carp::longmess @_"
Compilation failed in require at /usr/share/perl5/ExtUtils/MakeMaker.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/MakeMaker.pm line 11.
Compilation failed in require at Makefile.PL line 1.
BEGIN failed--compilation aborted at Makefile.PL line 1.
I don't really know how to proceed now...
--
Sebastien Digard - 2015-09-18
Dependency issue. You would need to downgrade CGI::Carp too.
--
Peter Thoeny - 2015-09-18
Hi All,
I couldn't get to downgrade my Perl modules.
As I've been using the VM version of twiki, here is my sledgehammer solution (works for dummies like me):
1- archive your /var/www/twiki folder on a shared folder
2- create a new virtual box, install a new TWiki-VM-6.0.1-1 on it
3- override the twiki folder with the archived one
Brutal. but it worked for me.
--
Sebastien Digard - 2015-09-22
When you restore make sure to omit
twiki/data/TWiki and
twiki/data/TWiki/pub. If you restore that you mix the old and new TWiki installation, e.g. new preferences settings, new system layout with old templates.
--
Peter Thoeny - 2015-09-22
A new extension is now available that addresses the CGI issue:
CgiContrib - for background see
AddCGIpmToTWikiCore.
--
Peter Thoeny - 2015-10-28
Recently, I tried to reach the configuration of the TWiki, and got the following error:
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 (www-data) 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/share/perl/5.10/CGI.pm line 933.
BEGIN failed--compilation aborted at (eval 7) line 2.
Apparently, TWiki only allows a CGI.pm file lower than 4.04 (
http://twiki.org/cgi-bin/view/Support/SID-02079
).
So I checked the CGI.pm file in the location mentioned in the error (/usr/share/perl/5.10 is a symbolic link to /usr/share/perl/5.10.1), and saw the following version number:
$CGI::VERSION='4.38';You can also check the version of the CGI.pm file by issuing the following command:
perl -e 'use CGI; print $CGI::VERSION."\n"'
Since I have TWiki 6.0.1 (in the past, I successfully updated from 4.3 to 6.0.1, but I was not able to update the 6.0.1 to 6.0.2...), the CGI Contrib Package solution (
http://twiki.org/cgi-bin/view/Plugins/CgiContrib
) was no option.
Since I had installed perl 5.12 alongside the default 5.10 version on Ubuntu 10.04, I looked for the version of the CGI.pm included with that perl version. It appeared to be 3.48, which is good for TWiki.
I downloaded the 3.48 release of CGI.pm from:
http://search.cpan.org/~lds/CGI.pm-3.48/
and uncompressed it.
In /usr/share/perl/5.10.1, I renamed CGI.pm file to CGI438.pm and the CGI folder to CGI438.
Then I copied the contents of the lib subfolder of the uncompressed downloaded CGI to /usr/share/perl/5.10.1.
Afterwards, I was able again to reach the configure page of TWiki.
--
Stijn Bousard - 2018-03-02
By the way, I am using Ubuntu 10.04.4 LTS
--
Stijn Bousard - 2018-03-02
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.