1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

部分cgi 500错误

本帖由 fsun2007-07-08 发布。版面名称:后端开发

  1. fsun

    fsun New Member

    注册:
    2007-02-25
    帖子:
    29
    赞:
    0
    套件wamp5,自己装的ActivePerl-5.8.8.820



    目录如下
    D:\wamp
    D:\wamp\Apache2
    D:\wamp\www
    D:\wamp\php
    D:\wamp\perl 安装ActivePerl
    D:\wamp\cgi-bin 放置cgi



    测试hello.pl可以
    代码:
    print "Content-type: text/html\n\n";
    print "hello world";
    测试test.pl 500错误
    代码:
    ## printenv -- demo CGI program which just prints its environment
    
    ##
    
    use strict;
    print "Content-type: text/html\n\n";
    print "
    Environment variables
    
          ";
          foreach (sort keys %ENV) {
          my $val = $ENV{$_};
          $val =~ s|\n|\\n|g;
          $val =~ s|"|\\"|g;
        * print "$_ = \"${val}\"
          \n";
          }
          #sleep(10);
    
          print "
    
    ";
    运行mt里的mt-check.cgi可以的
    但运行mt.cgi就500错误




    错误日志
    代码:
    [Sun Jul 08 15:25:05 2007] [error] String found where operator expected at D:/wamp/cgi-bin/test.pl line 16, near "* print "$_ = \\"${val}\\"\r\n      \\n""\n  (Might be a runaway multi-line "" string starting on line 15)\nsyntax error at D:/wamp/cgi-bin/test.pl line 16, near "* print "$_ = \\"${val}\\"\r\n      \\n""\n
    [Sun Jul 08 15:34:59 2007] [error] [client 127.0.0.1] File does not exist: D:/wamp/www/images, referer: http://localhost/perl/mt/mt-check.cgi


    附httpd.conf
     
  2. laogui

    laogui Administrator
    管理成员

    注册:
    2005-08-30
    帖子:
    15,216
    赞:
    35
    CGI文件开头改了没有?