Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I'm have Win 2k installed with ActivePerl and Apache
HTTPD server and i get this error trying out the CGI program:

Sat Dec 29 03:18:33 2001 error client 10.100.97.194
couldn't spawn child process: c:/program files/apache
group/apache/cgi-bin/readinput.cgi

IE shows 'Internal Sever Error 500'

#!/usr/bin/perl
I have tried changing this first line of the script:
#!/perl/bin/perl
#!\perl\bin\perl
But it doesn't help...
Anyone pls help me.... Thanks a million!

Replies are listed 'Best First'.
Re: Could Spawn Child Process
by IlyaM (Parson) on Dec 29, 2001 at 00:50 UTC
      Or you might include Perl's directory in your PATH and just say
      #!perl
Re: Could Spawn Child Process
by fiddi (Acolyte) on Dec 29, 2001 at 05:51 UTC

    The first line of your script merely points to what is going to drive your script. On windows boxes, I understand that this line is not needed. If you can find your program through your path, that's all you need.

    That said, though, you can and should include the line so that you can enable switches with it, '-w', for example, or '-Tw', etc. If you don't 'use warnings;' in your script, then you should indeed use the warn switch '-w' on your shebang line.

    So your error? Something else. Start a new question with your error and include your script, or at least the part of your script that you think might cause the error.

    As much as I don't like referring people away, you might like to check this great troubleshoot of 500 errors:

    http://www.users.f2s.com/faq/error500.php3

    Dave

      On windows boxes, I understand that this line is not needed.

      It is not needed if you run script as usual program on windows. In this case file associations come to play. However if you run script as CGI using Apache normally Apache emulates UNIX behaviour. Apache ignores file associations and reads shebang line to find script interpretator. BTW if I recall correctly Win32 Apache has an option which is off by default. That option forces Apache to use file associations and ignore shebang line.

      --
      Ilya Martynov (http://martynov.org/)

      A reply falls below the community's threshold of quality. You may see it by logging in.