Tags:
create new tag
view all tags

Question

I just switched from Win+IIS to Win+Apache (because AuthenticationOnIisWithoutLAN is not possible). Now I'm facing two details that I can't figure out on my own.

  1. How can I switch from cygwin Perl 5.8 to Active State Perl 5.6.1 (also installed)?
    • The testenv states that it uses the cygwin 5.8 version, but I want it to use Activestate 5.6.1 instead.
    • DONE Solution: Reran the cygwin installer and specifically selected Perl version 5.6.1. (The installer uses the newest by default, which was 5.8.) This is just as well as the Activestate version, so I'm happy.
  2. I tried to redo the cpan installation for Digest but it fails. How can I fix it?
    • When I try to register users, I get a software error:
      • Can't locate Digest/SHA1.pm in @INC (@INC contains: ../lib . /usr/lib/perl5/5.8.0/cygwin-multi-64int /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at c:\twiki\bin\register line 37.
    • DONE Solved. This took some work. The original problem was that some path (HOME and perhaps also TEMP) was set to C:\documents and settings\username\ rather than e.g. c:\cygwin\home\yourcygwinloginusername\, and when I first ran cpan it stored this path-with-spaces-in-it for later use. Later on, the install Digest::SHA1 failed because it tried to access that spaced path, but since cygwin does not handle spaced paths, it failed.
      DONE Solution: First, I had to get rid of the incorrect path that cpan remembered. Since I don't know the first thing about cygwin, I simply deleted the c:\cygwin directory and reinstalled cygwin all over again. Then, before I started cpan for the (new) first time, I used the command export USERPROFILE=c:\\cygwin\\home\\yourcygwinloginusername to set various variables to that path. Several paths had spaces in them, and I set each one of them like this example. I also created the c:\cygwin\home\yourcygwinloginusername directory. Then I was ready to run cpan and it worked like described in the documentation.
    • Big thanks to RichardDonkin for patience on this page, and to MartinRaabe, MartinCleaver and KimHansen for their time on TWikiIRC!

Here's the cpan output [ TorbenGB 03 Jun 2003 - reduced for sake of brevity; new version is below]:

cpan> install Digest::SHA1
Running install for module Digest::SHA1
Running make for G/GA/GAAS/Digest-SHA1-2.02.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /c/Documents and Settings/gbdk/.cpan/sources/authors/id/G/GA/GAAS/D
igest-SHA1-2.02.tar.gz ok
Scanning cache /c/Documents and Settings/gbdk/.cpan/build for sizes
cannot open /c/Documents: no such file
Package seems to come without Makefile.PL.
  (The test -f "/c/Documents and Settings/gbdk/.cpan/build/GAAS003/Makefile.PL"
returned false.)
  Writing one on our own (setting NAME to DigestSHA1)

  CPAN.pm: Going to build G/GA/GAAS/Digest-SHA1-2.02.tar.gz

Writing Makefile for DigestSHA1
  /usr/bin/make  -- OK
Running make test
No tests defined for DigestSHA1 extension.
  /usr/bin/make test -- OK
Running make install
Writing /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int/auto/DigestSHA1/.packl
ist
Appending installation info to /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/perllocal.pod
  /usr/bin/make install  -- OK

cpan>

  • TWiki version: 01Feb2003
  • Perl version: cygwin 5.8 [ TorbenGB 03 Jun 2003: Successfully changed to v5.6.1]
  • Web server & version: Apache 1.3.27
  • Server OS: Windows XP Pro
  • Web browser & version: any, but here IE 6.0 and Mozilla 1.4
  • Client OS: any, but here Windows XP
  • TWiki URL: http://twiki.no-ip.com
  • testenv_output_new.htm: The testenv results (as per 03 Jun).
  • TWiki.cfg: The TWiki configuration.

-- TorbenGB - 31 May 2003

Answer

Thanks for the TWiki.cfg and testenv output. Cygwin Perl 5.8 is not the problem here, I think - it should work, though Cygwin Perl 5.6.1 is a better option. See WindowsInstallCookbook for the way to install TWiki using Cygwin Perl and Apache, which has a high success rate if you follow all the steps.

Your problem is similar to InstallDigestSHA1Fails - one possible solution is in last comment, i.e. just setting TEMP to a directory without a space in the name.

Also, be sure to run the cpan installation command from the Cygwin shell, not from the Windows DOS Prompt (cmd.exe) - using the Cygwin shell ensures that HOME is also set to something that doesn't contain space, which I think is the problem here. If for some reason you can't do this, just set HOME to something like c:\torben that doesn't include spaces.

Hope this helps.

-- RichardDonkin - 31 May 2003

Thanks for your help, Richard! I started the cygwin installer and noticed that the Perl version was listed as 5.8 (which of course is what it has told me all along, see above). I clicked the arrow button next to uninstall > reinstall > remove > 5.6.1 until it showed the version number, and then I also chose to reinstall all the other packages listed in WindowsInstallCookbook for good measure. Upon rebooting, the http://twiki.no-ip.com/bin/testenv report now reports that it's running 5.6.1-1 (Cygwin), so that bit is solved now.

With regard to InstallDigestSHA1Fails, I noticed this bit in the cpan output quoted above:

cpan> install Digest::SHA1
Running install for module Digest::SHA1
Running make for G/GA/GAAS/Digest-SHA1-2.02.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /c/Documents and Settings/gbdk/.cpan/sources/authors/id/G/GA/GAAS/D
igest-SHA1-2.02.tar.gz ok
Scanning cache /c/Documents and Settings/gbdk/.cpan/build for sizes
cannot open /c/Documents: no such file

Obviously, cygwin is using a Windows path with spaces in it (for something - for what?). If I could change this path to a nonspaced path, then I suspect that the cpan installation would succeed.

So, how do I do that? For this I must kindly ask you to be explicit, since I'm an absolute cygwin/cpan/unix novice. (Please forgive my ignorance.) With my Dos/Windows background, I'm assuming that there's a path statement which I can somehow replace with a new string from the command line, and then simply follow the WindowsInstallCookbook guidelines again.

-- TorbenGB - 01 Jun 2003

The spaces in pathnames issue is what I was talking about above, particularly re the HOME variable since that's how the cpan installer tool finds the $HOME/.cpan directory where it keeps its files.

The simplest thing is to launch cpan from within the Cygwin shell, as mentioned, and to check that HOME is set to something like /home/torben (without spaces) by doing echo $HOME. Attaching the output of env to this topic may help in diagnosing this, but TEMP and HOME are the key variables to check. It's worth noting that testenv only tests your CGI environment - here, the problem is with your Cygwin environment.

Alternatively, just uninstall everything and follow the WindowsInstallCookbook to the letter, which is virtually guaranteed to work.

-- RichardDonkin - 01 Jun 2003

Sorry that I didn't get your point immediately. (I'm still a novice.) I had some help in the #twiki IRC to determine that the paths given in my Cygwin environment have spaces in them ( HOME="/c/Documents and Settings/gbdk" ). They taught me how to set these to short docume~1 paths instead, so I changed all paths that had spaces in them into shortname paths. Then I ran the cpan Digest::SHA1 installer again, but it still listed the same _spaced _paths as are quoted above!

Here's the ENV listing [ TorbenGB 03 Jun 2003 - reduced for sake of brevity; new version is below]:

!::=::\ 
!C:=C:\cygwin\bin
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\gbdk\Application Data
COMMONPROGRAMFILES=C:\Program Files\Common Files
COMPUTERNAME=GB
COMSPEC=C:\WINDOWS\system32\cmd.exe
HOME=/c/Documents and Settings/gbdk
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\gbdk
LOGNAME=gbdk
LOGONSERVER=\\GB
MAKE_MODE=unix
MANPATH=:/usr/ssl/man
NUMBER_OF_PROCESSORS=1
OLDPWD=/usr/bin
OS=Windows_NT
PATH=/usr/local/bin:/usr/bin:/bin:/c/Perl/bin/:/c/WINDOWS/system32:/c/WINDOWS:/c
/WINDOWS/System32/Wbem:/usr/bin:/c/perl/bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0602
PROGRAMFILES=C:\Program Files
PROMPT=$P$G
PS1=\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$
PWD=/c/Documents and Settings/gbdk
RCSINIT=-x,v
SESSIONNAME=Console
SHLVL=1
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=/c/DOCUME~1/gbdk/LOCALS~1/Temp
TERM=cygwin
TMP=/c/DOCUME~1/gbdk/LOCALS~1/Temp
USER=gbdk
USERDOMAIN=GB
USERNAME=gbdk
USERPROFILE=C:\Documents and Settings\gbdk
WINDIR=C:\WINDOWS
_=/usr/bin/env

-- TorbenGB - 01 Jun 2003

The env output shows that HOME still has spaces in the path, which is the problem. TEMP is already OK.

You need to set HOME to a non-space path from Windows - on Windows NT it's the System applet in the Control panel that you use. On one system I use, HOME is set to c:\cygwin\home\rdonkin. Keeping everything under Cygwin has some benefits but is not essential - you should also be able to use c:\docume~1\gdbk or whatever. You must close and restart the Cygwin shell after changing Windows environmental settings.

-- RichardDonkin - 01 Jun 2003

Thanks Richard, but the thing is that even when I manually set all the paths in cygwin's env listing to e.g. c:\cygwin then when I run cpan it still wants to use the wrong paths.

Running install for module Digest::SHA1
Running make for G/GA/GAAS/Digest-SHA1-2.02.tar.gz
CPAN: MD5 loaded ok
Checksum for /c/Documents and Settings/gbdk/.cpan/sources/authors/id/G/GA/GAAS/D
igest-SHA1-2.02.tar.gz ok
Scanning cache /c/Documents and Settings/gbdk/.cpan/build for sizes
cannot open /c/Documents: no such file
Package seems to come without Makefile.PL.
  (The test -f "/c/Documents and Settings/gbdk/.cpan/build/GAAS008/Makefile.PL"
returned false.)

For the record, here's the env output just prior to the above cpan output. Please let me know if you see anything that is wrong. The green parts are those I manually changed from their default values.

$ env
!::=::\
!C:=C:\cygwin\bin
ALLUSERSPROFILE=c:\cygwin
APPDATA=c:\cygwin
COMMONPROGRAMFILES=c:\cygwin
COMPUTERNAME=GB
COMSPEC=C:\WINDOWS\system32\cmd.exe
HOME=/c/docume~1
HOMEDRIVE=C:
HOMEPATH=c:\cygwin
LOGNAME=gbdk
LOGONSERVER=\\GB
MAKE_MODE=unix
MANPATH=:/usr/ssl/man
NUMBER_OF_PROCESSORS=1
OLDPWD=/usr/bin
OS=Windows_NT
PATH=/usr/local/bin:/usr/bin:/bin:/c/Perl/bin/:/c/WINDOWS/system32:/c/WINDOWS:/c
/WINDOWS/System32/Wbem:/usr/bin:/c/perl/bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0602
PROGRAMFILES=C:\Program Files
PROMPT=$P$G
PS1=\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$
PWD=/c/docume~1
RCSINIT=-x,v
SESSIONNAME=Console
SHLVL=1
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=/tmp
TERM=cygwin
TMP=/tmp
USER=gbdk
USERDOMAIN=GB
USERNAME=gbdk
USERPROFILE=c:\cygwin
WINDIR=C:\WINDOWS
_=/usr/bin/env

Somehow I need to force cpan to use a path other than what it assumes it should use, but how?

Apart from the above, I'm also missing the diff program, but I don't see how this can be. The diff program is in c:\cygwin\bin along with the rest, and the TWiki path seems to include it. This is from testenv:

Current PATH: /cygdrive/c/cygwin/bin;/cygdrive/c/windows/system32 
  Note: This is the actual PATH setting that will be used by Perl to run programs.
  It is normally identical to $safeEnvPath, unless that variable is empty.  
diff: Warning: 'diff' program was not found on the current PATH.

New testenv is attached for reference. (I also slightly refactored the topic to get rid of irrelevant parts.)

Btw, your recommendation to See WindowsInstallCookbook for the way to install TWiki using Cygwin Perl and Apache, which has a high success rate if you follow all the steps is good (and I was very particular about following the steps), but that I suspect the problems I'm having won't go away just by starting over. I think this is caused by running Cygwin on Windows XP.

-- TorbenGB - 03 Jun 2003

Just looked at your environment again, and the HOME setting is still a bit unusual, although it doesn't have spaces so should work now. I would recommend something like the following (be sure to do a mkdir /home/gbdk first): HOME=/home/gbdk. HOMEPATH and HOMEDRIVE are not used by Cygwin, these are Windows-only settings according to MSKB:100843. It would be worth fixing the HOME setting first anyway, since '~' means something else in Cygwin/Unix.

What may have happened is that cpan was first run with the broken HOME variable and at that point saved its configuration, which now includes the /c/Documents and Settings path. To check this, type o conf from within cpan (and include the output here). You can edit the parameters within cpan (see perldoc cpan, CONFIGURATION section, do an o conf commit to write to file) - or you can copy the file /usr/lib/perl5/5.6.1/cygwin-multi/CPAN/Config.pm (in my installation) to ~/.cpan/CPAN/MyConfig.pm and edit it there.

If all else fails, just delete the ~/.cpan directory, then uninstall perl and re-install it...

As for the diff program, what matters is the $safeEnvPath reported by testenv - if that doesn't include the diff program you will get this warning. Having looked at your testenv, this is set to /cygdrive/c/cygwin/bin;/cygdrive/c/windows/system32 including a semicolon, whereas Cygwin requires a colon - I would recommend you use /bin:/cygdrive/c/windows/system32, the /bin directory is same as /usr/bin in Cygwin and includes diff. The TWiki.cfg file does include comments about how to set a valid Cygwin path - I think just /bin by itself should work.

-- RichardDonkin - 03 Jun 2003

Thanks, I'll try that. Can I use the /cygdrive/c/...... notation for all paths in TWiki.cfg (and using : as a path separator where applicable)? Or only for certain statements within TWiki.cfg?

The different ways of writing paths are very confusing. It would be a lot easier to understand and manage if it is okay to use the same notation method throughout.

You say that the ~ character has a different meaning in Cygwin than in Windows, so e.g. C:\Docume~1 is not a valid cygwin path. You then use the ~ character in other paths, how should I treat these?

Thanks for your help!

-- TorbenGB - 04 Jun 2003

You can use /cygdrive/c/... for any path - however, /cygdrive/c/cygwin/bin can be shortened to just /bin, which is easier to read (assuming Cygwin is in c:\cygwin).

The paths are discussed a bit up front in WindowsInstallCookbook - this is somewhat confusing but the problem is that Windows and Unix are quite different in this area, so Cygwin has to try to cover up the differences in order for most Unix applications to work on Windows.

The '~' character means $HOME normally, when followed by a '/' - if '~' is followed by a userid, e.g. ~fsmith, it means the home directory for that user - this is true for most shells, such as bash, ksh, tcsh, etc, but is not implemented by the Cygwin/Unix OS layer. The C:\Docume~1 path is valid since it doesn't fit either of these two patterns - it's just that it would be better to put the Cygwin home directory elsewhere - this is really a matter of taste though.

-- RichardDonkin - 04 Jun 2003

Et voilà! Now I finally got it all-singing, all-dancing, all working! Thanks for all the help!! How? I've summarized it at the top of the page.

-- TorbenGB - 05 Jun 2003

At last!! Glad it's finally working - thanks for providing this much detail, it made it much easier to help out. This is virtually a textbook case of why following the SupportGuidelines really helps both parties. Also, I like your summary of the solution at the top - I've updated this slightly since it was the HOME variable at fault. WindowsInstallCookbook is already updated so this problem should never happen again!

-- RichardDonkin - 05 Jun 2003

You may also need to change /usr/lib/perl5/5.8/CPAN/Config.pm as well because it was reading directory names from here instead of from the $HOME env variable.

-- TWikiGuest - 13 Jul 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatcfg TWiki.cfg r1 manage 21.5 K 2003-05-31 - 05:39 UnknownUser The TWiki configuration.
HTMLhtm testenv_output.htm r1 manage 11.7 K 2003-05-31 - 05:40 UnknownUser The testenv output.
HTMLhtm testenv_output_new.htm r1 manage 11.4 K 2003-06-03 - 11:13 UnknownUser Current ver.: http://twiki.no-ip.com/bin/testenv
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2005-07-13 - TWikiGuest
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.