Tags:
create new tag
, view all tags

Question

I'm new to Windows/Cygwin, and I have a problem that has me pretty well stymied.

testenv runs very nearly correctly under the cygwin shell (i.e. cygwin> ./testenv > testpage.html). When I try to run it from a browser, however, perl complains (in the apache error log) that it cannot find vars.pm in @INC. In fact, vars.pm is in one of the directories whose path is in @INC.

It looks to me as if perl is, somehow, not being started in the cygwin env... but I'm just guessing. There is only one instance of perl on my system, it was installed as part of cygwin, and it gets run with the shebang:

#!c:/tools/cygwin/bin/perl -wT

I don't get it. Any help would be very much appreciated

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: win2k/cygwin
Web server: apache 1.3.28
Perl version: 5.6.1
Client OS: same
Web Browser: mozilla phoenix

-- BlakeMeike - 18 Oct 2003

Answer

Please post the testenv output - this is MUCH more useful than just having a few snippets mentioned in your posting, and should help us solve this issue. See SupportGuidelines for how to log support requests that will are more likely to get a useful response.

-- RichardDonkin - 21 Oct 2003

That's an answer???

You know, I actually read those SupportGuidelines reasonably carefully.

Since perl can't even compile the "use vars ..." statement at its head, testenv produces no output. Here is the error message from Apache's log file:

 [Fri Oct 17 16:18:11 2003] [error] [client 127.0.0.1] Premature end of script headers: c:/documents and settings/meikegb/website/twiki/bin/testenv
 [Fri Oct 17 16:18:11 2003] [error] [client 127.0.0.1] Can't locate vars.pm in @INC (@INC contains: ../lib /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 c:\DOCUME~1\meikegb\website\twiki\bin\testenv line 35.
 [Fri Oct 17 16:18:11 2003] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at c:\DOCUME~1\meikegb\website\twiki\bin\testenv line 35.

In cygwin's cli environment, "vars.pm" is in the libpath:

cygwin>ls /usr/lib/perl5/5.6.1/vars.pm 
/usr/lib/perl5/5.6.1/vars.pm

... and in that (the cli) environment, testenv will run. Here's the output:

  • te.html: Output of: "cd c:/twiki/bin; ./testenv > te.html"

If you can be helpful, I would truly appreciate it.

-- BlakeMeike - 21 Oct 2003

RE: "That's an answer???": I do not have an answer for you, just a friendly reminder. TWiki is open source, folks who monitor and answer questions in this support forum do that in their free time, as a favor, without any pay. An answer is not always obvious, but people will try to bring you further. If you want a quick answer for a compensation contact one of the ConsultantsForHire.

-- PeterThoeny - 22 Oct 2003

Problem solved. Many thanks for all the help.

-- BlakeMeike - 04 Nov 2003

I was asking for testenv output since you had obviously generated it even though on command line not CGI. The SupportGuidelines pointer was intended as a genuine suggestion - if people are reading it and still not attaching testenv output when it exists, maybe it needs a re-write...

Your second posting had rather more useful information, which was helpful (of course, I could have been truly unhelpful and said "That's a question???" at first...) but it's still not clear how you solved it. Presumably you tinkered with @INC or directory permissions, but it might help other people to say what fixed it.

The only real way to fix this sort of issue when testenv is not working is to write a short CGI script that dumps @INC to a file.

-- RichardDonkin - 05 Nov 2003

Interestingly my second posting was no more helpful to me! It produced no better suggestions than the first.

It turns out that the solution to my problem was really, really simple. I made a silly newbie mistake that anyone with any Windows experience would probably have caught immediately. A week after I'd given up any hope of getting help here, I stumbled on the solution, while solving a different problem entirely. As I tried to make clear in my original posting the solution has absolutely nothing to do with @INC and could not be diagnosed through the use of testenv.

I completely accept Peter's remonstration that I have no right to demand anything in this space. Indeed it all worked out: I have (awesome) twiki running on my windows box and I'm happy as can be. In the same spirit, though, I'll share a friendly reminder that just because somebody is a newbie to twiki/windows, doesn't mean they are clueless. Even in retrospect, the description of the problem that I gave in my original posting seems very accurate: It is certainly sufficient to diagnose a problem that I'd bet is not unique to me.

All the best, and thanks for the excellent tool.

-- BlakeMeike - 09 Nov 2003

Glad to see that you are up and running smile

So, just wondering, what was the solution? Other folks might have the same issue and would appreciate your insight.

-- PeterThoeny - 09 Nov 2003

Hi, I'm one of those folks who has run across the problem that BlakeMeike encountered, and fixed. I tried email, but that didn't work.

What was the solution? Peter was right that others [myself] would also stumble at this point.

I've installed twiki maybe 10 times at different work places, and I didn't commit this schoolboy error then, so I am curious as to what the fix is here. One of the painful bits of computer association is building up the minutiae of fixes. One more to add to the stack by the sounds of things.
-- TerryLurie - 15 Dec 2003

Okay, so I fixed it too.
-- TerryLurie - 23 Dec 2003

Just kidding, I am going to let everyone know what was wrong. If you get this problem it is because your %PATH% is not set for the Apache service properly. I was on an NT Domain, and had set my user %PATH% to include c:/cygwin/bin where Perl resides. But the Apache service runs as System , and so my %PATH% was not hitting it. I incorrectly fixed this by setting the service to run as my own account. This caused downstream problems, in that Taint checking caused a barf. There is a good solution to that problem already posted under another topic. I can't remember what it is, but if you get the error message, when you put the message into Google, the answer comes up No. #1, so just about as easy as a hyperlink anyway.

So, for the correct solution I had to get the Sys Admin to come add c:/cygwin/bin to the System %PATH%.

What I will say, the Taint checking caused me further grief, and I took the risk of removing it. Whilst it is better to find a solution if you have the time, I am under quite a time constraint on this Contract currently, and my employers would take a very dim view of me taking a further 3 hours to iron out the bugs. This is an internal Twiki, and not one likely to have malicious attacks thrown at it.
What I did was

cd /c/twiki/bin
perl -pi~ -e 's;#!c:/cygwin/bin/perl -wT;#!c:/cygwin/bin/perl -w;' *[a-z]

This removes taint checking and WILL get it working, but if you CAN find a better solution in the time you've got, DO.

-- TerryLurie - 23 Dec 2003

Topic attachments
I Attachment Action Size Date Who Comment
HTMLhtml te.html manage 13.8 K 2003-10-21 - 18:43 BlakeMeike Output of: "cd c:/twiki/bin; ./testenv > te.html
Topic revision: r10 - 2003-12-23 - TerryLurie
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.