in reply to Re: How to configure Apache for running perl scripts.
in thread How to configure Apache for running perl scripts.

I have added "Options +ExecCGI" line as you told.
But there are 2 similar places where i can add. And I have added the line in 2 places.

But in error log it is still saying that "ExecCGI is not enabled".
  • Comment on Re^2: How to configure Apache for running perl scripts.

Replies are listed 'Best First'.
Re^3: How to configure Apache for running perl scripts.
by Gilimanjaro (Hermit) on Aug 06, 2004 at 15:09 UTC
    The error message means:
    • Apache has found the script at the url you specified
    • Apache recognizes the extension, and is trying to use the cgi-script handler
    • But Apache's failsafe mechanism which required that ExecCGI is explicitly enabled is blocking you

    Look for other 'Options' directives, maybe below your +ExecCGI one, that disable it again (maybe not explicitly, but possibly by specifying None).

    Please take a good look at Apache's documentation on the Option directive and Directory, Location and Files blocks. Also make sure there are no .htaccess files around which override your Options directives. Without your complete apache config it's hard to exactly determine the exact cause. If you can't find it with these tips, put it on the web somewhere, and send me a message with the url. I'll have a look at it for ya...

      I have commented out "AllowOverride None"
      But now I am getting follwing log message
      "malformed header from script. Bad header = hello: /var/www/cgi-bin/a.pl"

      a.pl contains
      #!/usr/bin/perl
      use strict;
      use CGI;
      my $q =CGI->new();
      print $q->header("text/html");
      print "hello";
        Okay!

        Now it's at least running your script, but something is not 100% with the output... Try:

        #!/usr/bin/perl use strict; use warnings; use CGI qw(:all); print header; print "hello!";
        And chmod 755 a.pl just to be sure.

        If it still gives the error, run the script from the command line (./a.pl) and paste the output...

        (We'll get there yet!)