Apache2 cgi文件对apache不可见,html表单返回空值

Apache2 cgi文件对apache不可见,html表单返回空值,apache2,perl,cgi,Apache2,Perl,Cgi,我有一个html表格,每行有两个单选按钮和一个保存按钮。我想在保存时存储单选按钮的值,并在重新访问页面时预设该值。这是我编写的html代码 <form action='table_extract.cgi' method = 'post'> <td><input type='radio' name='signoff' value = 'approve'>Approve<br> <input type='radio

我有一个html表格,每行有两个单选按钮和一个保存按钮。我想在保存时存储单选按钮的值,并在重新访问页面时预设该值。这是我编写的html代码

<form action='table_extract.cgi' method = 'post'>
        <td><input type='radio' name='signoff' value = 'approve'>Approve<br>
        <input type='radio' name='signoff' value='review'>Review</td>
    <td><input type='submit' name='button' value='Save'/></td></form>

批准
复习
这是表_extract.cgi中的内容

#!usr/local/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use warnings;
print <<END;
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
END

my $regfile = 'signoff.out';
my $sign;
$sign = param('signoff');

open(REG,">>$regfile") or fail();
print REG "$sign\n";
close(REG);
print "param value :", param('signoff');
print <<END;
<title>Thank you!</title>
<h1>Thank you!</h1>
<p>signoff preference:$sign </p>
END

sub fail {
   print "<title>Error</title>",
   "<p>Error: cannot record your registration!</p>";
  exit; }
#!usr/local/bin/perl
使用CGI qw(:标准);
使用CGI::Carp qw(警告浏览者fatalsToBrowser);
严格使用;
使用警告;

打印如果此脚本可执行,我将从检查权限开始:

chmod +x table_extract.cgi
此外,请在中检查日志文件

/var/log/http/*
检查脚本是否运行时没有语法错误:

perl -c table_extract.cgi

如果您的HTML页面不在CGI bin目录下,请考虑将表单动作参数修改为:

<form action='/cgi-bin/table_extract.cgi' method = 'post'>


Apaches错误和访问日志中的任何条目?
chmod+x
不会在命令行上返回任何内容。我找不到日志文件。我不是root用户。脚本运行时没有任何语法错误。要通过浏览器访问html页面,我需要将html页面放在unix中的某个文件夹中,该文件夹不在
Apache
中。我试着把
cgi
脚本放在
cgi-bin
下,也放在html页面上。没有变化。我想你需要发送更多关于服务器的详细信息。您有权访问apache配置吗?它是什么服务器?如果启用了perl mod,这可能是服务器管理员的一个问题?chmod+x没有返回任何内容。它将可执行标志添加到文件中。