Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • 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

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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