Question
Sorry if this is a dumb question or if this has appeared before but I haven't seen it. Testenv will not run and Apache says: 'The server encountered an internal error or misconfiguration'. The Apache error log indicates:
[Thu Dec 15 13:44:37 2005] [error] [client 10.0.0.23] c:/twiki/bin/testenv is not executable; ensure interpreted scripts have "#!" first line
[Thu Dec 15 13:44:37 2005] [error] [client 10.0.0.23] (2)No such file or directory: couldn't spawn child process: c:/twiki/bin/testenv
Any tip appreciated, thank you - Daniel Simmons
Environment
--
TWikiGuest - 15 Dec 2005
Answer
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.
Sounds like perhaps the first line is not pointing to the correct perl location?
--
SteveRJones - 19 Jan 2006
This is not a dumb question! I had the same exact problem installing TWiki for the first time, and got exactly the same error messages with little explanation.
For more information on what to do for this type of error, see this web page, which is listed as a link elsewhere on this site:
http://michaelbluejay.com/webdesign/perl.html
So I found two problems that fixed this error.
The first is that when following the
WindowsInstallCookbook to the letter, the perl command used to change the shebang line didn't work, even when executed verbatim for what was in the
InstallCookbook. This is really easy to miss since the end result of what you're looking for is not completely spelled out if you're a novice. Make sure that if you're using cygwin that the end result of changing the shebang line for the scripts is that they no longer say /usr/bin/perl for the first line.
So I still haven't figured out why the verbatim perl command doesn't work, and in order to get around it I edited the files manually, since I happen to use an editor that supports saving w/ unix style line endings (no cr/lf combos). That notepad can be found here if desired--very nice:
http://www.flos-freeware.ch/
Once I edited the shebang line manually (for all files in that dir) to point to the cygwin directories I followed the advice on the first webpage for debugging perl scripts. I was able to run the script manually and dump it to an html file, but it still wouldn't run from the server, so there were only four things to check, and the thing that fixed it was the permissions. I suspect from editing the files manually that the permissions were reset (as you'll see from that webpage).
So after changing the shebang line, I went back and set the file and directory permissions by going to '/twiki' in the cygwin bash shell, and executing 'chmod 755 bin -R', which modifies all files in /twiki/bin with execution permissions. This has fixed the problem and now allows testenv to execute correctly.
--
JoshuaJohnston - 12 Feb 2006
Re
WindowsInstallCookbook - if you typed the Perl command line to edit shebang lines correctly, and were using
bash (Cygwin shell) not
cmd.exe, the editing does really work. The only other possibility is that you installed Cygwin somewhere other than
c:\cygwin and didn't change the Perl shebang editing command line.
That
CGI and Perl page
is very useful for beginners, will add that in somewhere.
--
RichardDonkin - 12 Feb 2006