Question
I installed TWiki with perl on cygwin and windows apache. Now when I try to acces any page, I get teh attached error.
[Wed Mar 27 22:38:23 2002] [error] [client 127.0.0.1] Premature end of script headers: e:/program_files/twiki/bin/view
[Wed Mar 27 22:38:23 2002] [error] [client 127.0.0.1] Can't locate CGI/Carp.pm in
@INC
(
@INC
contains: /usr/lib/perl5/5.6.1/cygwin-multi /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/cygwin-multi /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl) at e:\PROGRA~1\twiki\bin\view line 21.
[Wed Mar 27 22:38:23 2002] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at e:\PROGRA~1\twiki\bin\view line 21.
.
It looks like perl is using cygwin path, while apache uses windows path. And that is causing the error.
Any help would be appreciated.
--
TWikiGuest - 27 Mar 2002
Answer
It looks like you are missing the
CGI::Carp Perl module - this should be built in to Perl (since 5.005_03), according to the module list at
ReadmeFirst. You can install this using the
cpan command - see the
WindowsInstallCookbook for details. Also, please download and run the latest
testenv from
CookbookActivePerlTestenv, as this provides a lot more information, and checks for the required Perl modules.
The path setup shown is normal, and the INC path used by Perl looks OK, so I don't think that's the problem.
--
RichardDonkin - 28 Mar 2002
I checked my E:\Program_Files\cygwin\lib\perl5\5.6.1\CGI directory. The Carp.pm is present there. Is there any other way in which I can test that the module is installed or not?
--
TWikiGuest - 27 Mar 2002
Yes, just install the
testenv mentioned above, it loads this module as part of testing its version.
--
RichardDonkin - 28 Mar 2002
I get the same error even after downloading the new testenv
[Thu Mar 28 18:52:42 2002] [error] [client 127.0.0.1] Premature end of script headers: e:/program_files/twiki/bin/testenv
[Thu Mar 28 18:52:42 2002] [error] [client 127.0.0.1] Can't locate CGI.pm in
@INC
(
@INC
contains: /usr/lib/perl5/5.6.1/cygwin-multi /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/cygwin-multi /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl) at e:\PROGRA~1\twiki\bin\testenv line 21.
[Thu Mar 28 18:52:42 2002] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at e:\PROGRA~1\twiki\bin\testenv line 21.
--
TWikiGuest - 28 Mar 2002
This is a different error - the first one was about CGI::Carp, this is about CGI (i.e. CGI.pm). There's something broken about your Perl installation. The best thing IMO is to re-install Perl as follows (see full instructions for Cygwin setup in
WindowsInstallCookbook):
- Launch the Cygwin setup.exe (download from cygwin.com if needed), taking all the default choices
- Click on the New column entry for the perl-5.6.1 package until it says Uninstall, then go ahead (may upgrade some other packages, so exit any Cygwin shells first)
- Launch a Cygwin shell and do
rm -rf /lib/perl5 (type this very carefully!! It removes an entire file tree all at once...) to clean out any modules not uninstalled
- Launch Cygwin setup again and install Perl.
There's a bit more about a similar problem at
http://www.cygwin.com/ml/cygwin/2001-08/msg01370.html
Hope this helps.
--
RichardDonkin - 28 Mar 2002
Cool that worked. Thanks a lot.
--
TWikiGuest - 28 Mar 2002
Good stuff! While you were testing this, I wrote an enhanced version of
testenv that handles systems where the CGI or CGI::Carp modules are missing - it's at
CookbookActivePerlTestenv, and also in
TWikiAlphaRelease.
Thanks for raising this,
testenv is now a lot more robust and should pin this down more quickly in future.
--
RichardDonkin - 29 Mar 2002
This problem happens to me only when I run Apache as a service. Running Apache in Standalone mode, everything works fine. What's the difference? Weird. I'm using Apache 1.3.22 on Windows XP using local system account.
--
JohnWong - 08 Jul 2002
The difference is most likely due to the environment when running as a service. Try running the latest testenv, from
CVSget:bin/testenv
under (1) Apache as a service and (2) Apache standalone. In particular, check the setting of
@INC
and that all modules are found OK. There are ways of setting
@INC
directly, e.g. you can use the Apache SetEnv command as mentioned in
WindowsInstallCookbook - check the perl manual pages for details. It may even be that you are picking up a different version of Perl, so compare the two testenv pages carefully.
It would be good to raise a new support question on this topic, including details of your versions of TWiki, Perl, etc - see
AskedQuestions. Attaching the two testenv output pages to the new page would be useful.
--
RichardDonkin - 09 Jul 2002