http://qs321.pair.com?node_id=875133


in reply to Re: Exec format error
in thread Exec format error

I have updated (AddHandler) the Apache httpd.conf to execute only .pl
<Directory "mydir/tools/cgi-bin"> AllowOverride AuthConfig Options FollowSymLinks Order allow,deny Allow from all AddHandler cgi-script .pl </Directory>
But still getting the same error. I am new to Apache configuration ...anything else needs to be done.. Thanks again...

Replies are listed 'Best First'.
Re^3: Exec format error
by marto (Cardinal) on Dec 03, 2010 at 10:35 UTC

    Please read the error message, your target file as a .html extension. Looks like your webserver is trying to execute an html file. Read the apache documentation for more information.

Re^3: Exec format error
by Anonymous Monk on Dec 03, 2010 at 10:46 UTC
    <Directory "mydir/tools/cgi-bin"> ^
    I think the directory specification here needs to be a full (absolute) path in the filesystem. See <Directory>.
      sorry printing mistake...getting the same error with the following configuration
      <Directory "/mydir/tools/cgi-bin"> AddHandler cgi-script .pl AllowOverride AuthConfig Options FollowSymLinks Order allow,deny Allow from all </Directory>
Re^3: Exec format error
by Anonymous Monk on Dec 03, 2010 at 13:10 UTC
    It's hard to tell without seeing the rest of the config... but maybe you also have a ScriptAlias directive set up for the directory. That would have the effect of Apache trying to execute any file in it (with the execute bit set)...

    It's probably a good idea to read up on and understand the subtle differences between ScriptAlias, option ExecCGI, SetHandler and AddHandler, and then re-check your config. Also don't forget to restart apache after having made any changes (just in case you didn't...)

    See also Dynamic Content with CGI for an overview, and Configuration Sections (for understanding which scope directives will apply to).

    If that still doesn't help, it's probably appropriate to switch to some webserver/apache forum, as the issue isn't really related to Perl at all...

      Thanks for your help...