LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-29-2011, 02:02 PM   #1
linuxguy08
Member
 
Registered: Apr 2008
Posts: 155
Blog Entries: 2

Rep: Reputation: 15
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?
 
Old 03-29-2011, 02:59 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,204
Blog Entries: 1

Rep: Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059Reputation: 2059
Hi,

You need 2 new lines after "Content-type":
Code:
print "Content-type:text/html \n\n";
Regards
 
Old 03-30-2011, 12:54 PM   #3
linuxguy08
Member
 
Registered: Apr 2008
Posts: 155

Original Poster
Blog Entries: 2

Rep: Reputation: 15
Thank you very much !it works now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal server error (Premature end of cgi script) cbtshare Linux - Server 16 02-07-2011 03:17 PM
RHEL4 PHP5 CGI Internal Server Error with SugarCRM 5.5 geofflee Linux - Software 0 01-20-2010 12:37 AM
Apache CGI/Perl Internal Server Error CauticaL Linux - Software 7 07-10-2006 03:22 PM
CGI / Perl Internal Server Error newuser455 Linux - General 10 09-26-2004 02:50 AM
CGI Internal server error newuser455 Linux - General 2 06-10-2004 09:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration