All,
I have a file /var/www/cgi-bin/tryit.cgi:
#! /usr/local/bin/perl
# tryit.pl
use Acrobat::FDF;
$inFDF=new Acrobat::FDF('-',$ENV{'CONTENT_LENGTH'});
my $currentField;
my $currentValue;
print("Content-type: text/plain\n\n");
$currentField=$inFDF->NextFieldName("");
while($currentField)
{
$currentValue=$inFDF->GetValue($currentField);
print("Current field: $currentField CurrentValue: $currentValue\n");
$currentField=$inFDF->NextFieldName($currentField);
}
exit 0;
Serving with the Apache 2 server (2.0.40), I have a pdf file that calls
tryit.pl when its submit button is pressed. It processes the fdf output
from the pdf file:
Current field: dbName CurrentValue: QuizIt
Current field: dbTable CurrentValue: Math101
Current field: Quiz1.numCorrect CurrentValue: 1
Current field: Quiz1.numQuestions CurrentValue: 3
Current field: Quiz1.Responses CurrentValue: a,a,a
Current field: quizName CurrentValue: Quiz1
Now, shut down the Apache 2 server and start up Apache 1.3. Place the same
tryit.cgi in /usr/local/apache/cgi-bin, adjust the submit path in
Quiz1.tex,recompile to Quiz1.pdf, then call:
http://scinux.redwoods/online_testing/Quiz1.pdf
Again, all is well:
Current field: dbName CurrentValue: QuizIt
Current field: dbTable CurrentValue: Math101
Current field: Quiz1.numCorrect CurrentValue: 1
Current field: Quiz1.numQuestions CurrentValue: 3
Current field: Quiz1.Responses CurrentValue: a,a,a
Current field: quizName CurrentValue: Quiz1
Now, move tryit.cgi to
/usr/local/apache/htdocs/online_testing/perl/tryit.pl. Adjust the submit
path in Quiz1.tex, recompile to Quiz1.pdf, then call:
http://scinux.redwoods/online_testing/Quiz1.pdf
We now get the error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>200 OK</TITLE>
</HEAD><BODY>
<H1>OK</H1>
The server encountered an internal error or
misconfiguration and was unable to complete
your request.<P>
Please contact the server administrator,
[EMAIL PROTECTED] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.<P>
More information about this error may be available
in the server error log.<P>
<HR>
<ADDRESS>Apache/1.3.31 Server at scinux.redwoods.edu Port 80</ADDRESS>
</BODY></HTML>
And:
[EMAIL PROTECTED] apache]#tail logs/error_log
[Sat Jul 10 20:04:42 2004] [error] Can't call method "NextFieldName" on an
undefined value at /usr/local/apache/htdocs/online_testing/perl/tryit.pl
line 13.\n
In my httpd.conf, I've done this:
Alias /online_testing/ "/usr/local/apache/htdocs/online_testing/"
<Location /online_testing/>
AuthName OnlineTesting
AuthType Basic
PerlAuthenHandler Apache::AuthAny
require valid-user
PerlAccessHandler Apache::GateKeeper
PerlSetVar Gate open
</Location>
<Directory /usr/local/apache/htdocs/online_testing/perl/>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
PerlSendHeader On
allow from all
</Directory>
Does anyone know why it won't work in this last configuration?
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html