Debugging internal server errors (premature end of script headers) part 9

To sum it all up...

This is a long way from being a comprehensive troubleshooter. What I have tried to do here is to point you in the right direction to help you figure out why the script you are working with, doesn't. There is nothing worse than looking in your log files for the error, only to find 'premature end of script headers'. It doesn't tell you a whole lot, does it?

You don't have to receive the exact same error that I've used as examples here, but if you receive one similar then fixing it will be much the same. The main things you need to do to help debug a script are:
  1. use diagnostics
  2. use carp to send errors to the browser
  3. use die statements on any files/directories that get opened
The most common cause of errors are:
  1. wrong path to perl
  2. wrong chmod
  3. wrong server paths for the scripts to use