On 01/04/2003 09:15:34 Glenn Linderman wrote:

>On approximately 3/31/2003 1:58 PM, came the following characters from
>the keyboard of BB:
>> I have begun learning CGI from a book dated '96 which refers to UNIX as
a
>> platform. I am using Win32 and have a question about an example from the
>> book, which I assume works on some system, just not mine, hehe.
>> What I do using I.E. 6.x is:
>> 1. Enter the CGI path and filename in the browser Location field and
press
>> the Enter key
>> 2. Note: 'Internal Server Error' is received.
>> 3. Apache error log says:
>> [error]  [client] The system cannot find the file specified.  :couldn't
>> spawn child process: path/trythis.cgi

To BB:

This sounds like a webserver setup problem (which is sort of offtopic).

By default (i.e. the config
which is shipped with the installation), Apache enables CGI execution in
the cgi-bin directory _only_ . You cannot put the script just anywhere
because it will be treated as a plain file.

Hmm, that cannot be the problem; Apache clearly tried to execute the
script...
Please tell us EXACTLY

1) where Apache is installed (full path to ServerRoot),
2) where the script is
3) what URL did you type in the browser

>>
>> I suspect the '&' but can not find a ref to this functionality on Win32
with
>> ActivePerl 5.8.0.805
>>
>> #-----------trythis.cgi-------------
>> #!c/perl/bin/perl.exe

There might be a ':' missing there ( #!c:/perl/bin/perl.exe )
If perl.exe is in the path, then #!perl might be enough.

>> #
>> $data = 'C:/Apache2/Apache2/htdocs/counter.data';
>> $lockfile = 'C:/Apache2/Apache2/htdocs/counter.LOCK';
>> # main routine
>> print "Content-Type: text/html\n";
>> print "&increment";
>
>Indeed, according to the HTTP protocol, the above line is supposed to
>print out an additional HTTP header, since you haven't yet terminated
>the headers with a blank line.
>
>&increment
>
>is not a valid HTTP header... so that probably leads to the internal
>server error.
>
[snip]

I doubt this is the cause. Take a look at the error message provided
above: "couldn't spawn child process" means that almost certainly
the script itself was never executed, hence its content is irrelevant
(yet :-)


To BB:
Free advice which doesn't solve your problem but might save you
many headaches in the future:

use CGI;

CGI.pm takes care of outputting the correct headers, plus it has
nice HTML formatting routines for dynamic pages.

P.S. Please do _not_ CC me, I'm on the list.

--
Csaba Ráduly, Software Engineer, Sophos Anti-Virus
Email: [EMAIL PROTECTED], Tel: 01235 559933, Web: www.sophos.com
Add live virus info to your website: http://www.sophos.com/link/vfeed


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to