[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

500 error  "Premature end of script headers"

Posted on 2002-04-24
8
Medium Priority
?
548 Views
Last Modified: 2008-02-01
I have a PERL script that is a CGI that I get a 500 error on if I try to access it thru the browser. If I run it from the command line it works! I looked at the error logs and it says "Premature end of script headers"..
Any ideas?
0
Comment
Question by:sargento
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 6967404
sargento,

"..a PERL script th.."

Can you please post that Perl script here?

Meanwhile, i would suggest you ADD the following lines....

$|++;
print "Content-type: text/html\n\n";


......AS the 2nd line of your code.

Let me know how it goes.
0
 

Author Comment

by:sargento
ID: 6967410
THis is the test script i'm using:

#!/usr/bin/perl
$|++;
print "Content-type: text/html\n\n";


print "Hello World \n";

I'm sure that's the correct path for PERL.
0
 

Author Comment

by:sargento
ID: 6967433
I just transfered over a domain to a new isp and I'm setting everything up. I tested cgi-bin just to see and I get the above error mentioned.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:maneshr
ID: 6967487
sargento,

"..'m sure that's the correct path for PERL. ..."

How can you say that with certainty? Did you use the which command of UNIX to confirm the path?

".. I tested cgi-bin just to
                     see and I get the above error mentioned. ..."

Are you sure the permission on the file are ok? Are you certain that the cgi-bin directory in which you have the script is designated by the ISP as a CGI executable directory?

What is the output you get when you run the script from the command prompt?

Can you post the URL of the script that gives you this error?

Please provide as much more detail as you can.

This will help you get a more accurate answer, faster.

0
 

Author Comment

by:sargento
ID: 6967898
I did a whereis perl for the path.
I get this from the command line:

Content-type: text/html

Hello World

Here is the URL:

http://www.capoeirasj.com/cgi-bin/test.pl

The public_html and the cgi-bin are virtual directories, if that makes a difference?

0
 
LVL 16

Accepted Solution

by:
maneshr earned 800 total points
ID: 6969099
sargento,

"..I did a whereis perl for the path.
                     I get this from the command line:..."

From the command that you used & the output you get it looks that perl interpreter is in the right location and you can run/execute it too.

"..The public_html and the cgi-bin are virtual directories, .."

That should not make a difference. However, the cgi-bin directory needs to be configured so that it executes the script as a CGI program.

What web server are you using?What version of the web server are you using? What OS are you on?

Please let me know.
0
 

Author Comment

by:sargento
ID: 6969465
It turned out to be a permissions problem. I don't know why because I set the permissions to 755 but something strange was going on the server side?
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6969519
sargento,

"..It turned out to be a permissions problem. I.."

Excellent!! Glad to know you got the solution you were looking for.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question