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).
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: exec format error with CGI program
by davorg
in thread exec format error with CGI program
by lax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |