in reply to exec format error with CGI program

i wrote a html file in /var/www/cgi-bin....

You probably don't want to do that :-)

Your web server is probably configured to execute any files served from your cgi-bin directory. That makes sense as that's what the cgi-bin directory is for.

Therefore, any time your web server gets a request for a file in your cgi-bin directory, it tries to execute that file and return the output to the user.

An HTML file is not an executable program. Therefore the web server can't execute it and your operating system generates the error that you see.

The solution is to put cgi programs in the cgi-bin directory and static HTML files in the htdocs directory (or whatever the equivalent is in your configuration).

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: exec format error with CGI program
by lax (Initiate) on Jul 04, 2006 at 09:58 UTC
    hi

    thanks , your solution worked,i put the html file in the html folder and its workin now

    thanks
    lax
Re^2: exec format error with CGI program
by lukeyboy1 (Beadle) on Jul 04, 2006 at 14:15 UTC
    If it's the same as any other ISP, then they'll very likely be running any scripts within the cgi-bin directory using suEXEC. This means that the script needs to have 755 permissions set. Any other combination will cause it to fail. See this link for more details of my ISP.....

      Firstly, we don't know that there's an ISP involved at all. This sounds like a standard Apache installation which could be on the original poster's own Linux server (for example). The default Apache installation doesn't use suexec. So why complicate things unnecessarily.

      Secondly, the problem (and the solution) had absolutely nothing to do with programs or permissions. It was simply that the original poster had a static HTML file in his cgi-bin directory.

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg