代码之家  ›  专栏  ›  技术社区  ›  Abs

脚本头过早结束-什么,我不知道!

  •  2
  • Abs  · 技术社区  · 16 年前

    Premature end of script headers: test.pl

    以下是perl脚本:

    #!/usr/bin/perl -w
    print "Content-type: text/plain\n\n";
    print "testing...\n";
    

    cgi-bin 文件夹的权限为0755。剧本本身也是0755。脚本归apache所有,它位于apache组中。该脚本通过命令行运行良好。

    谢谢大家的帮助!

    更新

    2010-09-14 17:38:28]: uid: (10001/som) gid: (2522/2522) cmd: test.pl
    [2010-09-14 17:38:28]: target uid/gid (10001/2522 or 2521) mismatch with directory (48/0) or program (48/0)
    

    3 回复  |  直到 10 年前
        1
  •  3
  •   pjmorse    16 年前

    对于在PerlMonks上给出错误消息的Perl脚本,有很多很好的故障排除建议: start here . 我在您的脚本中没有看到任何特定的错误,而且看起来您已经涵盖了文件权限,因此我将从Apache配置建议开始。

        2
  •  9
  •   Community Mohan Dere    9 年前

    很多好建议: How can I troubleshoot my Perl CGI script

    看到suexec错误消息后更新:看起来您的服务器需要CGI程序与目录属于同一个用户。尝试更改文件的所有权。

        3
  •  0
  •   Ibrahim    16 年前

    use CGI qw/:standard/;
    $q = CGI->new;
    print $q->header('text/html');
    print "testing...\n";     
    
    推荐文章