LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CGI Internal Server error (https://www.linuxquestions.org/questions/linux-server-73/cgi-internal-server-error-871770/)

linuxguy08 03-29-2011 02:02 PM

CGI Internal Server error
 
I have small CGI-perl script written in my centos

#!/usr/bin/perl
print "Content-type:text/html \n";
print "The animal is \n";
print "The square of \n";

when i run from the browser it says following error
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

The error log says
malformed header from script. Bad header=The animal is : test4.cgi

What could be issue?

bathory 03-29-2011 02:59 PM

Hi,

You need 2 new lines after "Content-type":
Code:

print "Content-type:text/html \n\n";
Regards

linuxguy08 03-30-2011 12:54 PM

Thank you very much !it works now


All times are GMT -5. The time now is 02:53 PM.