• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

CGI errors

Hi,

whenever I try to run perl scripts on my webserver I get

The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: pingTest2.cgi

I figure I have apache set up wrong somewhere.

any ideas?

thanks
0
Paulmul
Asked:
Paulmul
  • 2
1 Solution
 
pjedmondCommented:
This implies that there is a problem with your scripts. Try running the cgi script from the command line and check that the information that it prints out is correct. (Use the -w option to get any extra data relating to the script errors concerned)

You can check everythng is working on the apache side by trying the following simple script:

--------------X8---------------
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";
print "Hi there!\n";

--------------X8---------------

One real headache that can cause this problem is that on a *nix system, you have DOS line endings. Make sure that the lines are ended appropriately for the system concerned.

HTH:)
0
 
PaulmulAuthor Commented:
The problem was I didn't have the cgi module installed. Currently trying to fix it.

Thanks anayway.
0
 
YensidModCommented:
I have PAQed the question and refunded the 50 points.

YensidMod
Experts Exchange Moderator
0
 
PaulmulAuthor Commented:
Just to add, to check this, go to where the httpd executable is. type ./httpd -l this will tell you what modules are installed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now