Error 500 - Server is Misconfigured?

Does anyone know what causes this Error?  
I'm running a script that executes fine from the command line (returns an error level of 0) on a linux server but when I hit it from my browser I get an Error 500 - Server is misconfigured error.  

My ISP wants to charge$$ for advice, so I'll ask here instead.  They are using a gateway called apache? (I think)  I've chmod'ed the .cgi file to 755 and the script is in the cgi-bin directory, so I'm all out of ideas...  anyone know what is going wrong with it?

Thanx in advance.
Who is Participating?
alweinerConnect With a Mentor Commented:
Here's how to tell (for free :)  what's happening.  Set-up a "wraparound" script


echo "Content-type: text/plain"
echo ""

Make sure the permissions on the new script are execute.  Then, call the new script from the www.  It will show you the actual error messages generated by your script.
KirkGrayAuthor Commented:
Thanx Alweiner,

The line #!/bin/sh made my script work.  
Tell me what it does and I'll give you the points!
What does it do?

(Called shebang) on the first line of a script, indicates what program
is going to run your script, as well as some arguments.

For instance,


indicates that the file is a bourne shell (or bash) script.

#!/usr/bin/perl -w

indicates that the file is to be run by /usr/bin/perl with the -w as a
parameter to the interpreter.

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.

All Courses

From novice to tech pro — start learning today.