So I'm using CentOS 6.7 and trying to set up a form. I can access the html using my browser, but once I input the information, the output gives me the internal server error. I've been looking for hours and can't find it. The only thing my error log says is this:

[Fri Oct 16 18:31:35 2015] [error] [client ::1] File does not exist: / +var/www/html/favicon.ico [Fri Oct 16 18:31:36 2015] [error] [client ::1] (2)No such file or dir +ectory: exec of '/var/www/cgi-bin/form.pl' failed, referer: http://lo +calhost/form.html [Fri Oct 16 18:31:36 2015] [error] [client ::1] Premature end of scrip +t headers: form.pl, referer: http://localhost/form.html [Fri Oct 16 18:31:44 2015] [error] [client ::1] (2)No such file or dir +ectory: exec of '/var/www/cgi-bin/form.pl' failed, referer: http://lo +calhost/form.html [Fri Oct 16 18:31:44 2015] [error] [client ::1] Premature end of scrip +t headers: form.pl, referer: http://localhost/form.html

My code for the html is as follows:
<html> <head> <title> Form Page Example </title> </head> <body background="light_blue_wallpaper.jpg"> <h1> Welcome! </h1> <form action=cgi-bin/form.pl method="get"> Name: <input type="text" name="user" size=40><p> Age: <input type="text" name="age" size=2 maxlength=3><p> Favorite Scripting Language: <br> <input type="radio" name="language" value="Bash">Bash<br> <input type="radio" name="language" value="Perl">Perl<br> <input type="radio" name="language" value="PHP">PHP<br> <input type="radio" name="language" value="Python">Python<br> <p> <input type="submit" value="Submit form"> <input type="reset" value="Clear all fields"> </form> All information submitted is confidental! </body> </html>

And my cgi script is as follows:

#!/user/bin/perl require("cgi-lib.pl"); &ReadParse(*input); print "Content-type: text/html\n\n"; print "<html> <body background=/var/www/html/light_blue_wallpaper.jpg> Hello <b>$input{user}</b><br> Your age: <b>$input{age}</b><br> Your favorite scripting language: <b>$input{language}</b><br> </html> </body>";

Anybody have any ideas? I'm stumped on this and getting frustrated because I feel like it's probably a stupid mistake that i can't catch.


In reply to Internal Server Error apache/httpd by mwerner92

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.