httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Kuang <>
Subject [users@httpd] internal error running cgi script
Date Fri, 03 Dec 2004 19:36:30 GMT
Hi everyone:

I am learning cgi scripting and running apache locally.  I have a form
in html that takes user input, and a cgi script in perl, to print on
screen what the user has entered:

Here is the html document, place in htdocs dir:

<b><font size=6>Test</font></b> 

<form method="post" action="../cgi-bin/">
<textarea name="comment" rows=8 cols=68></textarea>

<input type=submit value="Send">
<input type=reset value="Reset">


Here is my cgi script, in perl, located in cgi-bin dir:

#! /usr/bin/perl -w 
print "content-type: text/html\n\n";
read(STDIN, $format, $ENV{'CONTENT_LENGTH'});
print "<HTML><HEAD>\n";
print "<TITLE>Echo Form Data</TITLE>\n";
print "</HEAD><BODY>\n";
print "Here is what was collected\n";
print "<HR>\n";
@namevals = split(/&/, $formdat);
foreach (@namevals){
	tr/+/ /;
	s/%(..)/pack("C", hex($1))/ge;
	print "$_<BR>\n";
print "<P><HR>\n";
print "</BODY>\n</HTML>\n;

This is the error i get when I try to run the script:

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.

More information about this error may be available in the server error log.

Can anyone please help me with this problem.  Thank you very much in advance.

I am running apche in a windows environment, not *nix.


Ben Kuang

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message