Respected ppl …
Im on openSUSE 12.2 and my Apache server is running fine …
I copied the index.html which contains :
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>Program 7b</title></head>
<body>
<form method="POST" action="http://localhost/cgi-bin/7b.pl">
Please Enter the Command :
<input type="text" name="command" id="command" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
And the perl file as follows :
#!/usr/bin/perl
print "Content-type:text/html\n\n";
use CGI
$a = new CGI;
$comm = $a->param("command");
print "The Output of the entered command is:<br />";
system($comm);
Both files in the cgi-bin directory
But i get the error :
Premature end of script headers
On running localhost/cgi-bin/index.html in any browser ….
I have set the execution of perl files in the apache configuration …
Kindly help with the problem …
Regards
-SkyKOG
Apache is running index.html as a script, not simply displaying an HTML document. Apache is probably configured to run anything in the cgi directory as a script.
Move the html file into another directory.