I have this fairly complex python script im trying to run which imports other self-written modules and things like sqlite. When I go to run the script, I get a 500: internal server error and the log says: Premature end of script headers.
I know this means that I probably don't have my header correctly placed/typed but I believe I do.
#!/usr/bin/env python
import cgi
import cgitb; cgitb.enable(logdir=..., format="text")
print "Content-type: text/html"
print
Looks right, right?
I continue with the script and print the results at the end. All the other modules don't have the header or the hashbang, but I think that's fine.
What could the problem be?